{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "\n",
    "train=pd.read_csv('train.csv')\n",
    "train.drop(train.columns[[0]], axis=1,inplace=True)\n",
    "test=pd.read_csv('test.csv')\n",
    "test.drop(test.columns[[0]], axis=1,inplace=True)\n",
    "\n",
    "a=train.copy()\n",
    "a['prom_times']=a['prom_1']+a['prom_4']+a['prom_6']+a['prom_10']\n",
    "a=a.fillna({'prom_times':0})\n",
    "a['prom_ok']=a.prom_times.map(lambda x: 1 if x>=1 else 0)\n",
    "a['prom_type']=a['prom_1']*1000+a['prom_4']*100+a['prom_6']*10+a['prom_10']*1\n",
    "a=a.fillna(value={'prom_type':0})\n",
    "train=a.copy()\n",
    "\n",
    "\n",
    "a=test.copy()\n",
    "a['prom_times']=a['prom_1']+a['prom_4']+a['prom_6']+a['prom_10']\n",
    "a=a.fillna({'prom_times':0})\n",
    "a['prom_ok']=a.prom_times.map(lambda x: 1 if x>=1 else 0)\n",
    "a['prom_type']=a['prom_1']*1000+a['prom_4']*100+a['prom_6']*10+a['prom_10']*1\n",
    "a=a.fillna(value={'prom_type':0})\n",
    "test=a.copy()\n",
    "\n",
    "quantile=pd.read_csv('sku_quantile.csv')\n",
    "quantile.columns = ['sku_id','quantile']\n",
    "\n",
    "tt=pd.merge(train,quantile,on=['sku_id'],how='left')\n",
    "ttest=pd.merge(test,quantile,on=['sku_id'],how='left')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "train: (103047, 19)\n",
      "extend: (728627, 22)\n",
      "extend_last_month: (104176, 22)\n",
      "info: (103047, 8)\n",
      "qi_brand :done\n",
      "qi_promt :done\n",
      "qi_dc :done\n",
      "qi_brand_promt :done\n",
      "qi_brand_dc :done\n",
      "qi_promt_dc :done\n",
      "qi_brand_promt_dc :done\n",
      "qi_brand_first :done\n",
      "qi_first :done\n",
      "qi_brand_second :done\n",
      "qi_second :done\n",
      "qi_brand_third :done\n",
      "qi_third :done\n",
      "qi_brand_sku :done\n",
      "qi_sku :done\n",
      "qi_promt_first :done\n",
      "qi_promt_second :done\n",
      "qi_promt_third :done\n",
      "qi_promt_sku :done\n",
      "qi_dc_first :done\n",
      "qi_dc_second :done\n",
      "qi_dc_third :done\n",
      "qi_dc_sku :done\n",
      "qi_brand_promt_first :done\n",
      "qi_brand_promt_second :done\n",
      "qi_brand_promt_third :done\n",
      "qi_brand_promt_sku :done\n",
      "qi_brand_dc_first :done\n",
      "qi_brand_dc_second :done\n",
      "qi_brand_dc_third :done\n",
      "qi_brand_dc_sku :done\n",
      "qi_promt_dc_first :done\n",
      "qi_promt_dc_second :done\n",
      "qi_promt_dc_third :done\n",
      "qi_promt_dc_sku :done\n",
      "qi_brand_promt_dc_first :done\n",
      "qi_brand_promt_dc_second :done\n",
      "qi_brand_promt_dc_third :done\n",
      "qi_brand_promt_dc_sku :done\n",
      "qi_dine!\n",
      "qi_lastmonth_brand :done\n",
      "qi_lastmonth_promt :done\n",
      "qi_lastmonth_dc :done\n",
      "qi_lastmonth_brand_promt :done\n",
      "qi_lastmonth_brand_dc :done\n",
      "qi_lastmonth_promt_dc :done\n",
      "qi_lastmonth_brand_promt_dc :done\n",
      "qi_lastmonth_brand_first :done\n",
      "qi_lastmonth_first :done\n",
      "qi_lastmonth_brand_second :done\n",
      "qi_lastmonth_second :done\n",
      "qi_lastmonth_brand_third :done\n",
      "qi_lastmonth_third :done\n",
      "qi_lastmonth_brand_sku :done\n",
      "qi_lastmonth_sku :done\n",
      "qi_lastmonth_promt_first :done\n",
      "qi_lastmonth_promt_second :done\n",
      "qi_lastmonth_promt_third :done\n",
      "qi_lastmonth_promt_sku :done\n",
      "qi_lastmonth_dc_first :done\n",
      "qi_lastmonth_dc_second :done\n",
      "qi_lastmonth_dc_third :done\n",
      "qi_lastmonth_dc_sku :done\n",
      "qi_lastmonth_brand_promt_first :done\n",
      "qi_lastmonth_brand_promt_second :done\n",
      "qi_lastmonth_brand_promt_third :done\n",
      "qi_lastmonth_brand_promt_sku :done\n",
      "qi_lastmonth_brand_dc_first :done\n",
      "qi_lastmonth_brand_dc_second :done\n",
      "qi_lastmonth_brand_dc_third :done\n",
      "qi_lastmonth_brand_dc_sku :done\n",
      "qi_lastmonth_promt_dc_first :done\n",
      "qi_lastmonth_promt_dc_second :done\n",
      "qi_lastmonth_promt_dc_third :done\n",
      "qi_lastmonth_promt_dc_sku :done\n",
      "qi_lastmonth_brand_promt_dc_first :done\n",
      "qi_lastmonth_brand_promt_dc_second :done\n",
      "qi_lastmonth_brand_promt_dc_third :done\n",
      "qi_lastmonth_brand_promt_dc_sku :done\n",
      "qi_dine!\n",
      "train_extend: (103047, 1342)\n",
      "\n",
      "\n",
      "\n",
      "train: (179879, 19)\n",
      "extend: (1320845, 22)\n",
      "extend_last_month: (170408, 22)\n",
      "info: (179879, 8)\n",
      "qi_brand :done\n",
      "qi_promt :done\n",
      "qi_dc :done\n",
      "qi_brand_promt :done\n",
      "qi_brand_dc :done\n",
      "qi_promt_dc :done\n",
      "qi_brand_promt_dc :done\n",
      "qi_brand_first :done\n",
      "qi_first :done\n",
      "qi_brand_second :done\n",
      "qi_second :done\n",
      "qi_brand_third :done\n",
      "qi_third :done\n",
      "qi_brand_sku :done\n",
      "qi_sku :done\n",
      "qi_promt_first :done\n",
      "qi_promt_second :done\n",
      "qi_promt_third :done\n",
      "qi_promt_sku :done\n",
      "qi_dc_first :done\n",
      "qi_dc_second :done\n",
      "qi_dc_third :done\n",
      "qi_dc_sku :done\n",
      "qi_brand_promt_first :done\n",
      "qi_brand_promt_second :done\n",
      "qi_brand_promt_third :done\n",
      "qi_brand_promt_sku :done\n",
      "qi_brand_dc_first :done\n",
      "qi_brand_dc_second :done\n",
      "qi_brand_dc_third :done\n",
      "qi_brand_dc_sku :done\n",
      "qi_promt_dc_first :done\n",
      "qi_promt_dc_second :done\n",
      "qi_promt_dc_third :done\n",
      "qi_promt_dc_sku :done\n",
      "qi_brand_promt_dc_first :done\n",
      "qi_brand_promt_dc_second :done\n",
      "qi_brand_promt_dc_third :done\n",
      "qi_brand_promt_dc_sku :done\n",
      "qi_dine!\n",
      "qi_lastmonth_brand :done\n",
      "qi_lastmonth_promt :done\n",
      "qi_lastmonth_dc :done\n",
      "qi_lastmonth_brand_promt :done\n",
      "qi_lastmonth_brand_dc :done\n",
      "qi_lastmonth_promt_dc :done\n",
      "qi_lastmonth_brand_promt_dc :done\n",
      "qi_lastmonth_brand_first :done\n",
      "qi_lastmonth_first :done\n",
      "qi_lastmonth_brand_second :done\n",
      "qi_lastmonth_second :done\n",
      "qi_lastmonth_brand_third :done\n",
      "qi_lastmonth_third :done\n",
      "qi_lastmonth_brand_sku :done\n",
      "qi_lastmonth_sku :done\n",
      "qi_lastmonth_promt_first :done\n",
      "qi_lastmonth_promt_second :done\n",
      "qi_lastmonth_promt_third :done\n",
      "qi_lastmonth_promt_sku :done\n",
      "qi_lastmonth_dc_first :done\n",
      "qi_lastmonth_dc_second :done\n",
      "qi_lastmonth_dc_third :done\n",
      "qi_lastmonth_dc_sku :done\n",
      "qi_lastmonth_brand_promt_first :done\n",
      "qi_lastmonth_brand_promt_second :done\n",
      "qi_lastmonth_brand_promt_third :done\n",
      "qi_lastmonth_brand_promt_sku :done\n",
      "qi_lastmonth_brand_dc_first :done\n",
      "qi_lastmonth_brand_dc_second :done\n",
      "qi_lastmonth_brand_dc_third :done\n",
      "qi_lastmonth_brand_dc_sku :done\n",
      "qi_lastmonth_promt_dc_first :done\n",
      "qi_lastmonth_promt_dc_second :done\n",
      "qi_lastmonth_promt_dc_third :done\n",
      "qi_lastmonth_promt_dc_sku :done\n",
      "qi_lastmonth_brand_promt_dc_first :done\n",
      "qi_lastmonth_brand_promt_dc_second :done\n",
      "qi_lastmonth_brand_promt_dc_third :done\n",
      "qi_lastmonth_brand_promt_dc_sku :done\n",
      "qi_dine!\n",
      "train_extend: (179879, 1342)\n",
      "\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "def cacquantile(a,qi,i):\n",
    "    qi=np.array(qi)[0]#！！！！\n",
    "    aa={}\n",
    "    for k in a:\n",
    "        if k in aa.keys():\n",
    "            aa[k]=aa[k]+1\n",
    "        else:\n",
    "            aa[k]=1\n",
    "    \n",
    "    lena=len(a)\n",
    "    gradL=-qi*lena\n",
    "    ans=0\n",
    "    if lena==1:\n",
    "        ans=a[0]\n",
    "    if lena==2:\n",
    "        ans=max((qi*a[0]+(1-qi)*a[1]),(qi*a[1]+(1-qi)*a[0]))\n",
    "    if lena>=3:\n",
    "        uu=list(set(a))\n",
    "        uu=sorted(uu)\n",
    "        index=0\n",
    "        for k in uu:\n",
    "            y1=gradL\n",
    "            gradL+=aa[k]\n",
    "            if gradL>0:\n",
    "                if index==lena:#处理一下边界条件:最后才反转的\n",
    "                    x1=uu[index-1]\n",
    "                    x2=uu[index]\n",
    "                else:\n",
    "                    x1=(k+uu[index-1])/2\n",
    "                    x2=(k+uu[index+1])/2\n",
    "                y2=gradL\n",
    "                ans=-y1*(x1-x2)/(y1-y2)+x1#与x轴交点\n",
    "                \n",
    "                break\n",
    "            index+=1\n",
    "    return ans \n",
    "\n",
    "def getset(idset,retset,n,i=0,keyset=[]):\n",
    "    if len(keyset)==n:\n",
    "        kk=list(keyset)#桥重点啊！！！！！！！，不然奇奇怪怪bug\n",
    "        retset.append(kk)\n",
    "        return \n",
    "    for k in range(i,len(idset)):\n",
    "        key=idset[k]\n",
    "        if key not in keyset:\n",
    "            keyset.append(key)\n",
    "            getset(idset,retset,n,k,keyset)\n",
    "            keyset.remove(key)#与上面对应\n",
    "        \n",
    "def get_setid(idset,flag=0):\n",
    "    retset=[] \n",
    "    chooseone=['first','second','third','sku_id']\n",
    "    oneset=[]\n",
    "    for i in chooseone :\n",
    "        if i in idset:\n",
    "            idset.remove(i)\n",
    "            oneset.append(i)\n",
    "    for i in range(1,len(idset)+1):\n",
    "        qq=[]\n",
    "        getset(idset,qq,i)\n",
    "        retset.extend(qq)\n",
    "    rretset=list(retset)\n",
    "    for k in retset:\n",
    "        for i in oneset:\n",
    "            u=list(k)\n",
    "            u.append(i)\n",
    "            rretset.append(u) \n",
    "            rretset.append([i]) \n",
    "    #去重\n",
    "    reset=[]\n",
    "    for i in rretset:\n",
    "        if i not in reset:\n",
    "            reset.append(i)\n",
    "            \n",
    "    \n",
    "    if flag!=0:\n",
    "        #去掉过于复杂特征\n",
    "        return reset\n",
    "        types={'sku_id':1000,\n",
    "             'dc_id':6,\n",
    "             'first':3,\n",
    "               'second':19,\n",
    "               'third':96,\n",
    "               'brand':378,\n",
    "               'date':31,\n",
    "               'prom_type':23\n",
    "            }\n",
    "        ans=[]\n",
    "        for i in reset:\n",
    "            times=1\n",
    "            for key in i:\n",
    "                times*=types[key]\n",
    "            if times<=10000:\n",
    "                ans.append(i)\n",
    "        return ans\n",
    "    else:\n",
    "        return reset\n",
    "def getonefeature(key,idset,va,f,data,mark):\n",
    "    a=pd.DataFrame()\n",
    "    name=mark\n",
    "    for i in key:\n",
    "        a.loc[:,i]=data[i]\n",
    "        name+='_'+idset[i]\n",
    "    name+='_'+va\n",
    "    a.loc[:,name]=data[va]\n",
    "    a=pd.pivot_table(a,index=key,aggfunc=f)\n",
    "    a=a.reset_index()\n",
    "    #print name\n",
    "    return a\n",
    "def getfeature(idset,values,data,target,mark=''):\n",
    "    setid=get_setid(idset.keys())\n",
    "    retdf=target.copy()\n",
    "    GGG=['prom_1','prom_4','prom_6','prom_10','prom_ok','prom_times']\n",
    "    for key in setid:\n",
    "        for va in values.keys():\n",
    "            if ('prom_type' not in key) or (('prom_type' in key) & (va not in GGG)):\n",
    "                name=mark\n",
    "                for i in key:\n",
    "                    name+='_'+idset[i]\n",
    "                name+='_'+va\n",
    "                if name not in retdf:\n",
    "                    a=getonefeature(key,idset,va,values[va],data,mark)\n",
    "                    if len(setid)==1:\n",
    "                        oninf=key[0]\n",
    "                    else:\n",
    "                        oninf=key\n",
    "                    retdf = pd.merge(retdf, a, how='left',on=oninf)\n",
    "    return retdf\n",
    "        \n",
    "def changetime(time):\n",
    "    year,month,day=time.split('-')\n",
    "    year=str(int(year)-1)\n",
    "    time=year+'-'+month+'-'+day\n",
    "    #print time\n",
    "    return time\n",
    "def cacquantile(data):\n",
    "    a=np.array(data['quantity'])\n",
    "    q=np.array(data['quantile'])\n",
    "    \n",
    "    aa={}\n",
    "    for k in a:\n",
    "        if k in aa.keys():\n",
    "            aa[k]=aa[k]+1\n",
    "        else:\n",
    "            aa[k]=1\n",
    "    \n",
    "    lena=len(a)\n",
    "    gradL=0\n",
    "    for qi in q:\n",
    "        gradL-=qi\n",
    "    ans=0\n",
    "    uu=list(set(a))\n",
    "    uu=sorted(uu)\n",
    "    if len(uu)==1:\n",
    "        ans=uu[0]\n",
    "    if len(uu)>=2:\n",
    "        for index in range(len(uu)):\n",
    "            y1=gradL\n",
    "            gradL+=aa[uu[index]]\n",
    "            if gradL>0:\n",
    "                if index==len(uu)-1:#处理一下边界条件:最后才反转的\n",
    "                    x1=uu[index-1]\n",
    "                    x2=uu[index]\n",
    "                else:\n",
    "                    x1=(uu[index]+uu[index-1])/2\n",
    "                    x2=(uu[index]+uu[index+1])/2\n",
    "                y2=gradL\n",
    "                ans=-y1*(x1-x2)/(y1-y2)+x1#与x轴交点\n",
    "                \n",
    "                break\n",
    "    return ans \n",
    "def ccqi(keyset,data,mark):#计算qi分位点\n",
    "    name=mark\n",
    "    dddict={'sku_id':'sku',\n",
    "     'dc_id':'dc',\n",
    "     'first':'first',\n",
    "       'second':'second',\n",
    "       'third':'third',\n",
    "       'brand':'brand',\n",
    "        'prom_type':'promt'\n",
    "    }\n",
    "    a=pd.DataFrame()\n",
    "    for i in keyset:\n",
    "        name+='_'+dddict[i]\n",
    "        a[i]=data[i]\n",
    "    a[name]=data['quantity']+data['quantile']\n",
    "    a=a.groupby(keyset)[name].unique().reset_index()\n",
    "    def transform(x):\n",
    "        a=pd.DataFrame(x,columns=['qi_qu'])\n",
    "        a['quantity']=a['qi_qu'].map(lambda x:int(x))\n",
    "        a['quantile']=a['qi_qu']-a['quantity']\n",
    "        #print a\n",
    "        return cacquantile(a)\n",
    "    #print a\n",
    "    a.loc[:,name]=a[name].map(transform)\n",
    "    return a\n",
    "                \n",
    "def cacqiquan(idset,data,target,mark,quantile):\n",
    "    setid=get_setid(idset.keys(),1)\n",
    "    for keyset in setid:\n",
    "        \n",
    "        name=mark\n",
    "        dddict={'sku_id':'sku',\n",
    "         'dc_id':'dc',\n",
    "         'first':'first',\n",
    "           'second':'second',\n",
    "           'third':'third',\n",
    "           'brand':'brand',\n",
    "            'prom_type':'promt'\n",
    "        }\n",
    "        for i in keyset:\n",
    "            name+='_'+dddict[i]\n",
    "            \n",
    "        if name not in target:\n",
    "            a=ccqi(keyset,data,mark)\n",
    "            if len(a)==0:\n",
    "                print a\n",
    "            if len(a)>0:\n",
    "                target=pd.merge(target, a, how='left',on=keyset)\n",
    "        print name,':done'\n",
    "    print \"qi_dine!\"\n",
    "    return target\n",
    "def do_it(full,begin,finish,flag=0,testhist=0):\n",
    "    if flag==0:#验证集\n",
    "        train=full[(full.date>=begin)&(full.date<=finish)]\n",
    "        extend=full[(full.date>=changetime(begin))&(full.date<begin)]\n",
    "        \n",
    "        train=train.reset_index()\n",
    "        train.drop(['index'],axis=1,inplace=True)\n",
    "        extend=extend.reset_index()\n",
    "        extend.drop(['index'],axis=1,inplace=True)\n",
    "        \n",
    "        if begin=='2017-01-01':\n",
    "            begin='2016-12-01'\n",
    "            finish='2016-12-31'\n",
    "        if begin=='2017-12-01':\n",
    "            begin='2017-10-01'\n",
    "            finish='2017-10-31'\n",
    "        #print begin,finish\n",
    "        extend_last_month=full[(full.date>=begin)&(full.date<=finish)]\n",
    "        extend_last_month=extend_last_month.reset_index()\n",
    "        extend_last_month.drop(['index'],axis=1,inplace=True)\n",
    "        \n",
    "        #去除测试集没有的属性\n",
    "        train.drop(['vend','or_price','discount'],axis=1,inplace=True)\n",
    "        #清除 sum_quantity=0的数据\n",
    "        dd=train\n",
    "\n",
    "        a=pd.DataFrame()\n",
    "        a['sku_id']=dd.sku_id\n",
    "        a['y']=dd.quantity\n",
    "        a['dc_id']=dd.dc_id\n",
    "        g=a.groupby(['sku_id','dc_id'])['y'].sum().reset_index()\n",
    "        del a['y']\n",
    "        a=pd.merge(a,g,how='left',on=['sku_id','dc_id'])\n",
    "        \n",
    "        train.drop(a[a.y==0].index,inplace=True)\n",
    "        train=train.reset_index()\n",
    "        train.drop(['index'],axis=1,inplace=True)\n",
    "        #构造关于分位点参数便于自定义损失函数\n",
    "        z=train\n",
    "        info=pd.DataFrame()\n",
    "        info['sku_id']=z.sku_id\n",
    "        info['quantity']=z.quantity\n",
    "        info['dc_id']=z.dc_id\n",
    "\n",
    "        q=info.groupby(['sku_id','dc_id'])['quantity'].sum().reset_index()\n",
    "        q.rename(columns={'quantity':'sum_quantity'}, inplace=True) \n",
    "        info=pd.merge(info,q,how='left',on=['sku_id','dc_id'])\n",
    "\n",
    "        info['date']=z.date\n",
    "        info['quantile']=z['quantile']\n",
    "\n",
    "        #print info\n",
    "        info['k1']=info['quantile']/info.sum_quantity\n",
    "        info['k2']=(1-info['quantile'])/info.sum_quantity\n",
    "\n",
    "    else:\n",
    "        \n",
    "        extend=testhist[(testhist.date>=begin)&(testhist.date<=finish)]\n",
    "        extend=extend.reset_index()\n",
    "        extend.drop(['index'],axis=1,inplace=True)\n",
    "        \n",
    "        if begin=='2017-01-01':\n",
    "            begin='2017-12-01'\n",
    "            finish='2017-12-31'\n",
    "        \n",
    "        extend_last_month=testhist[(testhist.date>=begin)&(testhist.date<=finish)]\n",
    "        extend_last_month=extend_last_month.reset_index()\n",
    "        extend_last_month.drop(['index'],axis=1,inplace=True)\n",
    "        \n",
    "        train=full\n",
    "    \n",
    "    print 'train:',train.shape\n",
    "    print 'extend:',extend.shape\n",
    "    print 'extend_last_month:',extend_last_month.shape\n",
    "    if flag==0:\n",
    "        print 'info:',info.shape\n",
    "    \n",
    "    \n",
    "    \n",
    "    idset={'sku_id':'sku',\n",
    "     'dc_id':'dc',\n",
    "     'first':'first',\n",
    "       'second':'second',\n",
    "       'third':'third',\n",
    "       'brand':'brand',\n",
    "        'prom_type':'promt'\n",
    "    }\n",
    "    ans1=cacqiquan(idset,extend,train,'qi',quantile)\n",
    "    ans=cacqiquan(idset,extend_last_month,ans1,'qi_lastmonth',quantile)\n",
    "    \n",
    "    \n",
    "    idset={'sku_id':'sku',\n",
    "     'dc_id':'dc',\n",
    "     'first':'first',\n",
    "       'second':'second',\n",
    "       'third':'third',\n",
    "       'brand':'brand',\n",
    "       'prom_type':'promt'\n",
    "    }\n",
    "    #1 mean 2 sum \n",
    "    values={'quantity':np.mean,\n",
    "            'vend':np.sum,\n",
    "            'or_price':np.mean,\n",
    "            'discount':np.mean,\n",
    "            'prom_1':np.sum,\n",
    "            'prom_4':np.sum,\n",
    "            'prom_6':np.sum,\n",
    "            'prom_10':np.sum,\n",
    "            'prom_times':np.mean,\n",
    "            'prom_ok':np.sum,\n",
    "            'attr':np.mean,\n",
    "           'attr_values':np.mean,\n",
    "           'values_rate':np.mean}\n",
    "    train_hist=getfeature(idset,values,extend,ans,'hist')\n",
    "\n",
    "\n",
    "    idset={'sku_id':'sku',\n",
    "         'dc_id':'dc',\n",
    "         'first':'first',\n",
    "           'second':'second',\n",
    "           'third':'third',\n",
    "           'brand':'brand',\n",
    "           'date':'date',\n",
    "           'prom_type':'promt'\n",
    "        }\n",
    "    #1 mean 2 sum \n",
    "    values={\n",
    "            'prom_1':np.sum,\n",
    "            'prom_4':np.sum,\n",
    "            'prom_6':np.sum,\n",
    "            'prom_10':np.sum,\n",
    "            'prom_times':np.mean,\n",
    "            'prom_ok':np.sum,\n",
    "            'attr':np.mean,\n",
    "           'attr_values':np.mean,\n",
    "           'values_rate':np.mean}\n",
    "    train=getfeature(idset,values,train,train_hist,'now')\n",
    "    \n",
    "    \n",
    "    \n",
    "    idset={'sku_id':'sku',\n",
    "     'dc_id':'dc',\n",
    "     'first':'first',\n",
    "       'second':'second',\n",
    "       'third':'third',\n",
    "       'brand':'brand',\n",
    "        'prom_type':'promt'\n",
    "    }\n",
    "    #1 mean 2 sum \n",
    "    values={'quantity':np.mean,\n",
    "            'vend':np.sum,\n",
    "            'or_price':np.mean,\n",
    "            'discount':np.mean,\n",
    "            'prom_1':np.sum,\n",
    "            'prom_4':np.sum,\n",
    "            'prom_6':np.sum,\n",
    "            'prom_10':np.sum,\n",
    "            'prom_times':np.mean,\n",
    "            'prom_ok':np.sum,\n",
    "            'attr':np.mean,\n",
    "           'attr_values':np.mean,\n",
    "           'values_rate':np.mean}\n",
    "    ttrain=getfeature(idset,values,extend_last_month,train,'lastmonth')\n",
    "    \n",
    "    \n",
    "    print 'train_extend:',ttrain.shape\n",
    "    print '\\n\\n'\n",
    "    if flag==0:\n",
    "        return ttrain,info\n",
    "    else:\n",
    "        return ttrain\n",
    "train201701,info201701=do_it(tt,'2017-01-01','2017-01-31')\n",
    "train201712,info201712=do_it(tt,'2017-12-01','2017-12-31')\n",
    "\n",
    "\n",
    "    \n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "train: (186000, 18)\n",
      "extend: (1398858, 22)\n",
      "extend_last_month: (182189, 22)\n",
      "qi_brand :done\n",
      "qi_promt :done\n",
      "qi_dc :done\n",
      "qi_brand_promt :done\n",
      "qi_brand_dc :done\n",
      "qi_promt_dc :done\n",
      "qi_brand_promt_dc :done\n",
      "qi_brand_first :done\n",
      "qi_first :done\n",
      "qi_brand_second :done\n",
      "qi_second :done\n",
      "qi_brand_third :done\n",
      "qi_third :done\n",
      "qi_brand_sku :done\n",
      "qi_sku :done\n",
      "qi_promt_first :done\n",
      "qi_promt_second :done\n",
      "qi_promt_third :done\n",
      "qi_promt_sku :done\n",
      "qi_dc_first :done\n",
      "qi_dc_second :done\n",
      "qi_dc_third :done\n",
      "qi_dc_sku :done\n",
      "qi_brand_promt_first :done\n",
      "qi_brand_promt_second :done\n",
      "qi_brand_promt_third :done\n",
      "qi_brand_promt_sku :done\n",
      "qi_brand_dc_first :done\n",
      "qi_brand_dc_second :done\n",
      "qi_brand_dc_third :done\n",
      "qi_brand_dc_sku :done\n",
      "qi_promt_dc_first :done\n",
      "qi_promt_dc_second :done\n",
      "qi_promt_dc_third :done\n",
      "qi_promt_dc_sku :done\n",
      "qi_brand_promt_dc_first :done\n",
      "qi_brand_promt_dc_second :done\n",
      "qi_brand_promt_dc_third :done\n",
      "qi_brand_promt_dc_sku :done\n",
      "qi_dine!\n",
      "qi_lastmonth_brand :done\n",
      "qi_lastmonth_promt :done\n",
      "qi_lastmonth_dc :done\n",
      "qi_lastmonth_brand_promt :done\n",
      "qi_lastmonth_brand_dc :done\n",
      "qi_lastmonth_promt_dc :done\n",
      "qi_lastmonth_brand_promt_dc :done\n",
      "qi_lastmonth_brand_first :done\n",
      "qi_lastmonth_first :done\n",
      "qi_lastmonth_brand_second :done\n",
      "qi_lastmonth_second :done\n",
      "qi_lastmonth_brand_third :done\n",
      "qi_lastmonth_third :done\n",
      "qi_lastmonth_brand_sku :done\n",
      "qi_lastmonth_sku :done\n",
      "qi_lastmonth_promt_first :done\n",
      "qi_lastmonth_promt_second :done\n",
      "qi_lastmonth_promt_third :done\n",
      "qi_lastmonth_promt_sku :done\n",
      "qi_lastmonth_dc_first :done\n",
      "qi_lastmonth_dc_second :done\n",
      "qi_lastmonth_dc_third :done\n",
      "qi_lastmonth_dc_sku :done\n",
      "qi_lastmonth_brand_promt_first :done\n",
      "qi_lastmonth_brand_promt_second :done\n",
      "qi_lastmonth_brand_promt_third :done\n",
      "qi_lastmonth_brand_promt_sku :done\n",
      "qi_lastmonth_brand_dc_first :done\n",
      "qi_lastmonth_brand_dc_second :done\n",
      "qi_lastmonth_brand_dc_third :done\n",
      "qi_lastmonth_brand_dc_sku :done\n",
      "qi_lastmonth_promt_dc_first :done\n",
      "qi_lastmonth_promt_dc_second :done\n",
      "qi_lastmonth_promt_dc_third :done\n",
      "qi_lastmonth_promt_dc_sku :done\n",
      "qi_lastmonth_brand_promt_dc_first :done\n",
      "qi_lastmonth_brand_promt_dc_second :done\n",
      "qi_lastmonth_brand_promt_dc_third :done\n",
      "qi_lastmonth_brand_promt_dc_sku :done\n",
      "qi_dine!\n",
      "train_extend: (186000, 1341)\n",
      "\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "train201801=do_it(ttest,'2017-01-01','2017-12-31',1,tt)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "collapsed": true,
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "train1=train201701\n",
    "train2=train201712\n",
    "test=train201801\n",
    "info1=info201701\n",
    "info2=info201712"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(103047, 1342)\n",
      "(179879, 1342)\n",
      "(186000, 1341)\n",
      "(103047, 8)\n",
      "(179879, 8)\n"
     ]
    }
   ],
   "source": [
    "print train1.shape\n",
    "print train2.shape\n",
    "print test.shape\n",
    "print info1.shape\n",
    "print info2.shape\n",
    "#for i in sorted(list(train1.columns)):#看有哪些属性\n",
    "    #print i"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "train1.to_csv('train201701.csv',index=False)\n",
    "info1.to_csv('info201701.csv',index=False)\n",
    "train2.to_csv('train201712.csv',index=False)\n",
    "info2.to_csv('info201712.csv',index=False)\n",
    "test.to_csv('test201801.csv',index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   sku_id  quantity  dc_id  sum_quantity        date  quantile        k1  \\\n",
      "0     854       0.0      4          19.0  2017-01-09      0.99  0.052105   \n",
      "1      53       0.0      1          99.0  2017-01-24      0.99  0.010000   \n",
      "2     374       2.0      4         162.0  2017-01-14      0.97  0.005988   \n",
      "3     407       2.0      1         163.0  2017-01-07      0.96  0.005890   \n",
      "4     681      17.0      0          77.0  2017-01-09      0.95  0.012338   \n",
      "\n",
      "         k2  \n",
      "0  0.000526  \n",
      "1  0.000101  \n",
      "2  0.000185  \n",
      "3  0.000245  \n",
      "4  0.000649  \n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "info1 = pd.read_csv('info201701.csv')\n",
    "info2 = pd.read_csv('info201712.csv')\n",
    "train1 = pd.read_csv('train201701.csv')\n",
    "train2 = pd.read_csv('train201712.csv')\n",
    "test = pd.read_csv('test201801.csv')\n",
    "print info1.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "train1=train1.drop(['sku_id','dc_id','date','first','second','third','brand','quantile'],axis=1)\n",
    "train2=train2.drop(['sku_id','dc_id','date','first','second','third','brand','quantile'],axis=1)\n",
    "test=test.drop(['sku_id','dc_id','date','first','second','third','brand','quantile'],axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(103047, 1334)\n",
      "(179879, 1334)\n",
      "(186000, 1333)\n",
      "(103047, 8)\n",
      "(179879, 8)\n"
     ]
    }
   ],
   "source": [
    "print train1.shape\n",
    "print train2.shape\n",
    "print test.shape\n",
    "print info1.shape\n",
    "print info2.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0]\ttrain-rmse:202.487\ttest-rmse:130.511\ttrain-my_eval:88.6763\ttest-my_eval:155.061\n",
      "[1]\ttrain-rmse:202.469\ttest-rmse:130.487\ttrain-my_eval:83.6071\ttest-my_eval:146.635\n",
      "[2]\ttrain-rmse:202.453\ttest-rmse:130.467\ttrain-my_eval:79.359\ttest-my_eval:139.49\n",
      "[3]\ttrain-rmse:202.437\ttest-rmse:130.447\ttrain-my_eval:77.1793\ttest-my_eval:136.324\n",
      "[4]\ttrain-rmse:202.421\ttest-rmse:130.428\ttrain-my_eval:75.9799\ttest-my_eval:135.027\n",
      "[5]\ttrain-rmse:202.406\ttest-rmse:130.409\ttrain-my_eval:74.8949\ttest-my_eval:133.829\n",
      "[6]\ttrain-rmse:202.393\ttest-rmse:130.394\ttrain-my_eval:74.085\ttest-my_eval:132.804\n",
      "[7]\ttrain-rmse:202.378\ttest-rmse:130.39\ttrain-my_eval:73.2286\ttest-my_eval:132.848\n",
      "[8]\ttrain-rmse:202.366\ttest-rmse:130.375\ttrain-my_eval:72.4117\ttest-my_eval:131.754\n",
      "[9]\ttrain-rmse:202.353\ttest-rmse:130.371\ttrain-my_eval:71.6218\ttest-my_eval:131.879\n",
      "[10]\ttrain-rmse:202.342\ttest-rmse:130.359\ttrain-my_eval:70.9847\ttest-my_eval:131.371\n",
      "[11]\ttrain-rmse:202.329\ttest-rmse:130.343\ttrain-my_eval:70.4189\ttest-my_eval:130.565\n",
      "[12]\ttrain-rmse:202.315\ttest-rmse:130.34\ttrain-my_eval:70.1533\ttest-my_eval:131.56\n",
      "[13]\ttrain-rmse:202.305\ttest-rmse:130.328\ttrain-my_eval:69.9286\ttest-my_eval:131.818\n",
      "[14]\ttrain-rmse:202.292\ttest-rmse:130.326\ttrain-my_eval:69.6877\ttest-my_eval:132.682\n",
      "[15]\ttrain-rmse:202.281\ttest-rmse:130.313\ttrain-my_eval:69.598\ttest-my_eval:132.768\n",
      "[16]\ttrain-rmse:202.27\ttest-rmse:130.299\ttrain-my_eval:69.4192\ttest-my_eval:133.092\n",
      "[17]\ttrain-rmse:202.258\ttest-rmse:130.284\ttrain-my_eval:69.2763\ttest-my_eval:133.111\n",
      "[18]\ttrain-rmse:202.247\ttest-rmse:130.269\ttrain-my_eval:69.1204\ttest-my_eval:133.084\n",
      "[19]\ttrain-rmse:202.236\ttest-rmse:130.255\ttrain-my_eval:68.9886\ttest-my_eval:133.161\n",
      "[20]\ttrain-rmse:202.225\ttest-rmse:130.241\ttrain-my_eval:68.9234\ttest-my_eval:133.377\n",
      "[21]\ttrain-rmse:202.215\ttest-rmse:130.229\ttrain-my_eval:68.8262\ttest-my_eval:133.282\n",
      "[22]\ttrain-rmse:202.206\ttest-rmse:130.218\ttrain-my_eval:68.7356\ttest-my_eval:133.115\n",
      "[23]\ttrain-rmse:202.196\ttest-rmse:130.205\ttrain-my_eval:68.606\ttest-my_eval:132.979\n",
      "[24]\ttrain-rmse:202.186\ttest-rmse:130.192\ttrain-my_eval:68.4922\ttest-my_eval:133.024\n",
      "[25]\ttrain-rmse:202.177\ttest-rmse:130.179\ttrain-my_eval:68.3988\ttest-my_eval:133.093\n",
      "[26]\ttrain-rmse:202.167\ttest-rmse:130.167\ttrain-my_eval:68.3688\ttest-my_eval:132.996\n",
      "[27]\ttrain-rmse:202.158\ttest-rmse:130.155\ttrain-my_eval:68.2994\ttest-my_eval:133.134\n",
      "[28]\ttrain-rmse:202.15\ttest-rmse:130.144\ttrain-my_eval:68.2379\ttest-my_eval:133.312\n",
      "[29]\ttrain-rmse:202.142\ttest-rmse:130.133\ttrain-my_eval:68.1633\ttest-my_eval:133.497\n",
      "[30]\ttrain-rmse:202.133\ttest-rmse:130.122\ttrain-my_eval:68.0862\ttest-my_eval:133.713\n",
      "[31]\ttrain-rmse:202.125\ttest-rmse:130.112\ttrain-my_eval:68.0309\ttest-my_eval:133.821\n",
      "[32]\ttrain-rmse:202.117\ttest-rmse:130.102\ttrain-my_eval:67.9668\ttest-my_eval:133.678\n",
      "[33]\ttrain-rmse:202.11\ttest-rmse:130.093\ttrain-my_eval:67.918\ttest-my_eval:133.685\n",
      "[34]\ttrain-rmse:202.103\ttest-rmse:130.083\ttrain-my_eval:67.8438\ttest-my_eval:133.993\n",
      "[35]\ttrain-rmse:202.097\ttest-rmse:130.077\ttrain-my_eval:67.8164\ttest-my_eval:134.215\n",
      "[36]\ttrain-rmse:202.09\ttest-rmse:130.067\ttrain-my_eval:67.7447\ttest-my_eval:134.385\n",
      "[37]\ttrain-rmse:202.083\ttest-rmse:130.058\ttrain-my_eval:67.677\ttest-my_eval:134.376\n",
      "[38]\ttrain-rmse:202.076\ttest-rmse:130.049\ttrain-my_eval:67.5815\ttest-my_eval:134.491\n",
      "[39]\ttrain-rmse:202.069\ttest-rmse:130.041\ttrain-my_eval:67.5262\ttest-my_eval:134.623\n",
      "[40]\ttrain-rmse:202.063\ttest-rmse:130.032\ttrain-my_eval:67.4509\ttest-my_eval:135.074\n",
      "[41]\ttrain-rmse:202.056\ttest-rmse:130.024\ttrain-my_eval:67.3582\ttest-my_eval:135.677\n",
      "[42]\ttrain-rmse:202.05\ttest-rmse:130.016\ttrain-my_eval:67.277\ttest-my_eval:135.819\n",
      "[43]\ttrain-rmse:202.044\ttest-rmse:130.009\ttrain-my_eval:67.2081\ttest-my_eval:136.181\n",
      "[44]\ttrain-rmse:202.038\ttest-rmse:130.001\ttrain-my_eval:67.1307\ttest-my_eval:136.183\n",
      "[45]\ttrain-rmse:202.032\ttest-rmse:129.993\ttrain-my_eval:67.0559\ttest-my_eval:136.101\n",
      "[46]\ttrain-rmse:202.027\ttest-rmse:129.986\ttrain-my_eval:66.9813\ttest-my_eval:136.381\n",
      "[47]\ttrain-rmse:202.021\ttest-rmse:129.978\ttrain-my_eval:66.8966\ttest-my_eval:136.504\n",
      "[48]\ttrain-rmse:202.015\ttest-rmse:129.972\ttrain-my_eval:66.8058\ttest-my_eval:137.038\n",
      "[49]\ttrain-rmse:202.011\ttest-rmse:129.966\ttrain-my_eval:66.7235\ttest-my_eval:137\n",
      "[50]\ttrain-rmse:202.005\ttest-rmse:129.959\ttrain-my_eval:66.6464\ttest-my_eval:137.39\n",
      "[51]\ttrain-rmse:202\ttest-rmse:129.953\ttrain-my_eval:66.5782\ttest-my_eval:137.749\n",
      "[52]\ttrain-rmse:201.995\ttest-rmse:129.946\ttrain-my_eval:66.5028\ttest-my_eval:137.741\n",
      "[53]\ttrain-rmse:201.99\ttest-rmse:129.94\ttrain-my_eval:66.4143\ttest-my_eval:137.851\n",
      "[54]\ttrain-rmse:201.985\ttest-rmse:129.933\ttrain-my_eval:66.3379\ttest-my_eval:137.835\n",
      "[55]\ttrain-rmse:201.98\ttest-rmse:129.928\ttrain-my_eval:66.2655\ttest-my_eval:138.117\n",
      "[56]\ttrain-rmse:201.976\ttest-rmse:129.922\ttrain-my_eval:66.2108\ttest-my_eval:138.362\n",
      "[57]\ttrain-rmse:201.971\ttest-rmse:129.916\ttrain-my_eval:66.1214\ttest-my_eval:138.461\n",
      "[58]\ttrain-rmse:201.966\ttest-rmse:129.91\ttrain-my_eval:66.0422\ttest-my_eval:138.751\n",
      "[59]\ttrain-rmse:201.962\ttest-rmse:129.904\ttrain-my_eval:65.9734\ttest-my_eval:138.759\n",
      "[60]\ttrain-rmse:201.958\ttest-rmse:129.899\ttrain-my_eval:65.9022\ttest-my_eval:138.727\n",
      "[61]\ttrain-rmse:201.953\ttest-rmse:129.893\ttrain-my_eval:65.8491\ttest-my_eval:138.713\n",
      "[62]\ttrain-rmse:201.949\ttest-rmse:129.888\ttrain-my_eval:65.8014\ttest-my_eval:138.781\n",
      "[63]\ttrain-rmse:201.945\ttest-rmse:129.883\ttrain-my_eval:65.7395\ttest-my_eval:138.768\n",
      "[64]\ttrain-rmse:201.941\ttest-rmse:129.878\ttrain-my_eval:65.692\ttest-my_eval:138.943\n",
      "[65]\ttrain-rmse:201.937\ttest-rmse:129.873\ttrain-my_eval:65.6295\ttest-my_eval:139.091\n",
      "[66]\ttrain-rmse:201.933\ttest-rmse:129.868\ttrain-my_eval:65.5626\ttest-my_eval:139.33\n",
      "[67]\ttrain-rmse:201.93\ttest-rmse:129.863\ttrain-my_eval:65.5098\ttest-my_eval:139.624\n",
      "[68]\ttrain-rmse:201.926\ttest-rmse:129.859\ttrain-my_eval:65.4541\ttest-my_eval:139.526\n",
      "[69]\ttrain-rmse:201.922\ttest-rmse:129.854\ttrain-my_eval:65.3939\ttest-my_eval:139.519\n",
      "[70]\ttrain-rmse:201.919\ttest-rmse:129.85\ttrain-my_eval:65.3464\ttest-my_eval:139.56\n",
      "[71]\ttrain-rmse:201.915\ttest-rmse:129.846\ttrain-my_eval:65.2932\ttest-my_eval:139.479\n",
      "[72]\ttrain-rmse:201.911\ttest-rmse:129.841\ttrain-my_eval:65.2263\ttest-my_eval:139.425\n",
      "[73]\ttrain-rmse:201.908\ttest-rmse:129.836\ttrain-my_eval:65.18\ttest-my_eval:139.401\n",
      "[74]\ttrain-rmse:201.904\ttest-rmse:129.832\ttrain-my_eval:65.1393\ttest-my_eval:139.579\n",
      "[75]\ttrain-rmse:201.901\ttest-rmse:129.827\ttrain-my_eval:65.0926\ttest-my_eval:139.498\n",
      "[76]\ttrain-rmse:201.898\ttest-rmse:129.824\ttrain-my_eval:65.0336\ttest-my_eval:139.493\n",
      "[77]\ttrain-rmse:201.894\ttest-rmse:129.819\ttrain-my_eval:64.9804\ttest-my_eval:139.644\n",
      "[78]\ttrain-rmse:201.89\ttest-rmse:129.815\ttrain-my_eval:64.9393\ttest-my_eval:139.559\n",
      "[79]\ttrain-rmse:201.887\ttest-rmse:129.811\ttrain-my_eval:64.895\ttest-my_eval:139.503\n",
      "[80]\ttrain-rmse:201.884\ttest-rmse:129.807\ttrain-my_eval:64.8791\ttest-my_eval:139.476\n",
      "[81]\ttrain-rmse:201.881\ttest-rmse:129.803\ttrain-my_eval:64.8434\ttest-my_eval:139.76\n",
      "[82]\ttrain-rmse:201.878\ttest-rmse:129.799\ttrain-my_eval:64.783\ttest-my_eval:139.779\n",
      "[83]\ttrain-rmse:201.875\ttest-rmse:129.796\ttrain-my_eval:64.7326\ttest-my_eval:139.783\n",
      "[84]\ttrain-rmse:201.872\ttest-rmse:129.792\ttrain-my_eval:64.6947\ttest-my_eval:139.703\n",
      "[85]\ttrain-rmse:201.869\ttest-rmse:129.789\ttrain-my_eval:64.6544\ttest-my_eval:140.059\n",
      "[86]\ttrain-rmse:201.867\ttest-rmse:129.785\ttrain-my_eval:64.6167\ttest-my_eval:140.07\n",
      "[87]\ttrain-rmse:201.864\ttest-rmse:129.782\ttrain-my_eval:64.576\ttest-my_eval:140.071\n",
      "[88]\ttrain-rmse:201.862\ttest-rmse:129.779\ttrain-my_eval:64.5355\ttest-my_eval:140.321\n",
      "[89]\ttrain-rmse:201.859\ttest-rmse:129.776\ttrain-my_eval:64.4966\ttest-my_eval:140.243\n",
      "[90]\ttrain-rmse:201.857\ttest-rmse:129.773\ttrain-my_eval:64.4669\ttest-my_eval:140.399\n",
      "[91]\ttrain-rmse:201.854\ttest-rmse:129.77\ttrain-my_eval:64.442\ttest-my_eval:140.381\n",
      "[92]\ttrain-rmse:201.85\ttest-rmse:129.765\ttrain-my_eval:64.3913\ttest-my_eval:140.375\n",
      "[93]\ttrain-rmse:201.848\ttest-rmse:129.762\ttrain-my_eval:64.3728\ttest-my_eval:140.446\n",
      "[94]\ttrain-rmse:201.846\ttest-rmse:129.76\ttrain-my_eval:64.3308\ttest-my_eval:140.475\n",
      "[95]\ttrain-rmse:201.843\ttest-rmse:129.757\ttrain-my_eval:64.3061\ttest-my_eval:140.539\n",
      "[96]\ttrain-rmse:201.841\ttest-rmse:129.753\ttrain-my_eval:64.2825\ttest-my_eval:140.577\n",
      "[97]\ttrain-rmse:201.838\ttest-rmse:129.75\ttrain-my_eval:64.255\ttest-my_eval:140.774\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[98]\ttrain-rmse:201.836\ttest-rmse:129.748\ttrain-my_eval:64.2251\ttest-my_eval:140.825\n",
      "[99]\ttrain-rmse:201.833\ttest-rmse:129.744\ttrain-my_eval:64.2035\ttest-my_eval:140.801\n",
      "[100]\ttrain-rmse:201.831\ttest-rmse:129.742\ttrain-my_eval:64.1563\ttest-my_eval:140.806\n",
      "[101]\ttrain-rmse:201.829\ttest-rmse:129.739\ttrain-my_eval:64.1221\ttest-my_eval:140.706\n",
      "[102]\ttrain-rmse:201.826\ttest-rmse:129.736\ttrain-my_eval:64.1138\ttest-my_eval:140.732\n",
      "[103]\ttrain-rmse:201.824\ttest-rmse:129.733\ttrain-my_eval:64.0727\ttest-my_eval:140.963\n",
      "[104]\ttrain-rmse:201.822\ttest-rmse:129.73\ttrain-my_eval:64.0133\ttest-my_eval:141.004\n",
      "[105]\ttrain-rmse:201.819\ttest-rmse:129.726\ttrain-my_eval:63.9777\ttest-my_eval:141.077\n",
      "[106]\ttrain-rmse:201.816\ttest-rmse:129.723\ttrain-my_eval:63.9446\ttest-my_eval:141.1\n",
      "[107]\ttrain-rmse:201.814\ttest-rmse:129.721\ttrain-my_eval:63.9232\ttest-my_eval:141.056\n",
      "[108]\ttrain-rmse:201.812\ttest-rmse:129.718\ttrain-my_eval:63.898\ttest-my_eval:141.052\n",
      "[109]\ttrain-rmse:201.81\ttest-rmse:129.715\ttrain-my_eval:63.8649\ttest-my_eval:141.203\n",
      "[110]\ttrain-rmse:201.808\ttest-rmse:129.713\ttrain-my_eval:63.8564\ttest-my_eval:141.267\n",
      "[111]\ttrain-rmse:201.805\ttest-rmse:129.709\ttrain-my_eval:63.8221\ttest-my_eval:141.35\n",
      "[112]\ttrain-rmse:201.803\ttest-rmse:129.706\ttrain-my_eval:63.789\ttest-my_eval:141.337\n",
      "[113]\ttrain-rmse:201.801\ttest-rmse:129.704\ttrain-my_eval:63.7661\ttest-my_eval:141.358\n",
      "[114]\ttrain-rmse:201.799\ttest-rmse:129.702\ttrain-my_eval:63.7052\ttest-my_eval:141.6\n",
      "[115]\ttrain-rmse:201.796\ttest-rmse:129.699\ttrain-my_eval:63.668\ttest-my_eval:141.555\n",
      "[116]\ttrain-rmse:201.794\ttest-rmse:129.697\ttrain-my_eval:63.6523\ttest-my_eval:141.555\n",
      "[117]\ttrain-rmse:201.791\ttest-rmse:129.693\ttrain-my_eval:63.6112\ttest-my_eval:141.713\n",
      "[118]\ttrain-rmse:201.79\ttest-rmse:129.691\ttrain-my_eval:63.5846\ttest-my_eval:141.94\n",
      "[119]\ttrain-rmse:201.787\ttest-rmse:129.687\ttrain-my_eval:63.5564\ttest-my_eval:141.974\n",
      "[120]\ttrain-rmse:201.784\ttest-rmse:129.684\ttrain-my_eval:63.5213\ttest-my_eval:142.111\n",
      "[121]\ttrain-rmse:201.782\ttest-rmse:129.681\ttrain-my_eval:63.4918\ttest-my_eval:142.233\n",
      "[122]\ttrain-rmse:201.78\ttest-rmse:129.679\ttrain-my_eval:63.4798\ttest-my_eval:142.218\n",
      "[123]\ttrain-rmse:201.778\ttest-rmse:129.676\ttrain-my_eval:63.4409\ttest-my_eval:142.287\n",
      "[124]\ttrain-rmse:201.776\ttest-rmse:129.675\ttrain-my_eval:63.4157\ttest-my_eval:142.29\n",
      "[125]\ttrain-rmse:201.774\ttest-rmse:129.671\ttrain-my_eval:63.4077\ttest-my_eval:142.315\n",
      "[126]\ttrain-rmse:201.772\ttest-rmse:129.669\ttrain-my_eval:63.3876\ttest-my_eval:142.479\n",
      "[127]\ttrain-rmse:201.77\ttest-rmse:129.667\ttrain-my_eval:63.3626\ttest-my_eval:142.78\n",
      "[128]\ttrain-rmse:201.768\ttest-rmse:129.665\ttrain-my_eval:63.3293\ttest-my_eval:142.765\n",
      "[129]\ttrain-rmse:201.767\ttest-rmse:129.663\ttrain-my_eval:63.2876\ttest-my_eval:142.906\n",
      "[130]\ttrain-rmse:201.765\ttest-rmse:129.661\ttrain-my_eval:63.2674\ttest-my_eval:142.917\n",
      "[131]\ttrain-rmse:201.763\ttest-rmse:129.658\ttrain-my_eval:63.2317\ttest-my_eval:142.988\n",
      "[132]\ttrain-rmse:201.761\ttest-rmse:129.656\ttrain-my_eval:63.2118\ttest-my_eval:142.97\n",
      "[133]\ttrain-rmse:201.759\ttest-rmse:129.654\ttrain-my_eval:63.1904\ttest-my_eval:143.312\n",
      "[134]\ttrain-rmse:201.757\ttest-rmse:129.652\ttrain-my_eval:63.17\ttest-my_eval:143.281\n",
      "[135]\ttrain-rmse:201.755\ttest-rmse:129.649\ttrain-my_eval:63.1434\ttest-my_eval:143.249\n",
      "[136]\ttrain-rmse:201.753\ttest-rmse:129.647\ttrain-my_eval:63.1373\ttest-my_eval:143.275\n",
      "[137]\ttrain-rmse:201.752\ttest-rmse:129.645\ttrain-my_eval:63.0976\ttest-my_eval:143.399\n",
      "[138]\ttrain-rmse:201.749\ttest-rmse:129.642\ttrain-my_eval:63.0821\ttest-my_eval:143.465\n",
      "[139]\ttrain-rmse:201.747\ttest-rmse:129.639\ttrain-my_eval:63.071\ttest-my_eval:143.521\n",
      "[140]\ttrain-rmse:201.745\ttest-rmse:129.637\ttrain-my_eval:63.0432\ttest-my_eval:143.552\n",
      "[141]\ttrain-rmse:201.743\ttest-rmse:129.635\ttrain-my_eval:62.9846\ttest-my_eval:143.579\n",
      "[142]\ttrain-rmse:201.741\ttest-rmse:129.632\ttrain-my_eval:62.9784\ttest-my_eval:143.706\n",
      "[143]\ttrain-rmse:201.739\ttest-rmse:129.63\ttrain-my_eval:62.9399\ttest-my_eval:143.645\n",
      "[144]\ttrain-rmse:201.738\ttest-rmse:129.628\ttrain-my_eval:62.9223\ttest-my_eval:143.695\n",
      "[145]\ttrain-rmse:201.736\ttest-rmse:129.626\ttrain-my_eval:62.8886\ttest-my_eval:143.648\n",
      "[146]\ttrain-rmse:201.735\ttest-rmse:129.624\ttrain-my_eval:62.8647\ttest-my_eval:143.593\n",
      "[147]\ttrain-rmse:201.732\ttest-rmse:129.621\ttrain-my_eval:62.8517\ttest-my_eval:143.615\n",
      "[148]\ttrain-rmse:201.73\ttest-rmse:129.618\ttrain-my_eval:62.84\ttest-my_eval:143.637\n",
      "[149]\ttrain-rmse:201.728\ttest-rmse:129.616\ttrain-my_eval:62.8243\ttest-my_eval:143.635\n",
      "[150]\ttrain-rmse:201.727\ttest-rmse:129.614\ttrain-my_eval:62.7956\ttest-my_eval:143.484\n",
      "[151]\ttrain-rmse:201.725\ttest-rmse:129.612\ttrain-my_eval:62.7714\ttest-my_eval:143.512\n",
      "[152]\ttrain-rmse:201.723\ttest-rmse:129.609\ttrain-my_eval:62.7626\ttest-my_eval:143.533\n",
      "[153]\ttrain-rmse:201.722\ttest-rmse:129.608\ttrain-my_eval:62.7344\ttest-my_eval:143.534\n",
      "[154]\ttrain-rmse:201.72\ttest-rmse:129.607\ttrain-my_eval:62.7303\ttest-my_eval:143.498\n",
      "[155]\ttrain-rmse:201.719\ttest-rmse:129.606\ttrain-my_eval:62.6948\ttest-my_eval:143.555\n",
      "[156]\ttrain-rmse:201.717\ttest-rmse:129.603\ttrain-my_eval:62.6855\ttest-my_eval:143.826\n",
      "[157]\ttrain-rmse:201.715\ttest-rmse:129.6\ttrain-my_eval:62.6438\ttest-my_eval:143.819\n",
      "[158]\ttrain-rmse:201.714\ttest-rmse:129.598\ttrain-my_eval:62.6122\ttest-my_eval:143.737\n",
      "[159]\ttrain-rmse:201.712\ttest-rmse:129.597\ttrain-my_eval:62.5959\ttest-my_eval:143.761\n",
      "[160]\ttrain-rmse:201.71\ttest-rmse:129.594\ttrain-my_eval:62.5781\ttest-my_eval:143.768\n",
      "[161]\ttrain-rmse:201.709\ttest-rmse:129.593\ttrain-my_eval:62.543\ttest-my_eval:143.758\n",
      "[162]\ttrain-rmse:201.707\ttest-rmse:129.591\ttrain-my_eval:62.5012\ttest-my_eval:143.753\n",
      "[163]\ttrain-rmse:201.705\ttest-rmse:129.588\ttrain-my_eval:62.5122\ttest-my_eval:143.836\n",
      "[164]\ttrain-rmse:201.703\ttest-rmse:129.586\ttrain-my_eval:62.5037\ttest-my_eval:143.911\n",
      "[165]\ttrain-rmse:201.702\ttest-rmse:129.584\ttrain-my_eval:62.4789\ttest-my_eval:143.85\n",
      "[166]\ttrain-rmse:201.7\ttest-rmse:129.582\ttrain-my_eval:62.4616\ttest-my_eval:143.866\n",
      "[167]\ttrain-rmse:201.699\ttest-rmse:129.581\ttrain-my_eval:62.4402\ttest-my_eval:143.823\n",
      "[168]\ttrain-rmse:201.698\ttest-rmse:129.579\ttrain-my_eval:62.4181\ttest-my_eval:143.765\n",
      "[169]\ttrain-rmse:201.696\ttest-rmse:129.576\ttrain-my_eval:62.3999\ttest-my_eval:143.764\n",
      "[170]\ttrain-rmse:201.694\ttest-rmse:129.575\ttrain-my_eval:62.3759\ttest-my_eval:143.751\n",
      "[171]\ttrain-rmse:201.692\ttest-rmse:129.572\ttrain-my_eval:62.3729\ttest-my_eval:143.732\n",
      "[172]\ttrain-rmse:201.691\ttest-rmse:129.57\ttrain-my_eval:62.3544\ttest-my_eval:143.714\n",
      "[173]\ttrain-rmse:201.689\ttest-rmse:129.568\ttrain-my_eval:62.3061\ttest-my_eval:143.673\n",
      "[174]\ttrain-rmse:201.687\ttest-rmse:129.566\ttrain-my_eval:62.3055\ttest-my_eval:143.735\n",
      "[175]\ttrain-rmse:201.686\ttest-rmse:129.565\ttrain-my_eval:62.2725\ttest-my_eval:143.913\n",
      "[176]\ttrain-rmse:201.684\ttest-rmse:129.563\ttrain-my_eval:62.2205\ttest-my_eval:144.006\n",
      "[177]\ttrain-rmse:201.682\ttest-rmse:129.56\ttrain-my_eval:62.2234\ttest-my_eval:144.088\n",
      "[178]\ttrain-rmse:201.681\ttest-rmse:129.559\ttrain-my_eval:62.2041\ttest-my_eval:144.152\n",
      "[179]\ttrain-rmse:201.68\ttest-rmse:129.557\ttrain-my_eval:62.1839\ttest-my_eval:144.127\n",
      "[180]\ttrain-rmse:201.678\ttest-rmse:129.556\ttrain-my_eval:62.1686\ttest-my_eval:144.093\n",
      "[181]\ttrain-rmse:201.677\ttest-rmse:129.554\ttrain-my_eval:62.1452\ttest-my_eval:144.121\n",
      "[182]\ttrain-rmse:201.676\ttest-rmse:129.553\ttrain-my_eval:62.1054\ttest-my_eval:144.256\n",
      "[183]\ttrain-rmse:201.674\ttest-rmse:129.55\ttrain-my_eval:62.099\ttest-my_eval:144.363\n",
      "[184]\ttrain-rmse:201.672\ttest-rmse:129.548\ttrain-my_eval:62.0701\ttest-my_eval:144.38\n",
      "[185]\ttrain-rmse:201.67\ttest-rmse:129.546\ttrain-my_eval:62.0498\ttest-my_eval:144.364\n",
      "[186]\ttrain-rmse:201.669\ttest-rmse:129.544\ttrain-my_eval:62.0238\ttest-my_eval:144.336\n",
      "[187]\ttrain-rmse:201.668\ttest-rmse:129.543\ttrain-my_eval:62.0035\ttest-my_eval:144.316\n",
      "[188]\ttrain-rmse:201.666\ttest-rmse:129.541\ttrain-my_eval:61.9856\ttest-my_eval:144.373\n",
      "[189]\ttrain-rmse:201.665\ttest-rmse:129.539\ttrain-my_eval:61.9633\ttest-my_eval:144.382\n",
      "[190]\ttrain-rmse:201.663\ttest-rmse:129.537\ttrain-my_eval:61.9556\ttest-my_eval:144.519\n",
      "[191]\ttrain-rmse:201.662\ttest-rmse:129.535\ttrain-my_eval:61.9265\ttest-my_eval:144.484\n",
      "[192]\ttrain-rmse:201.66\ttest-rmse:129.533\ttrain-my_eval:61.9017\ttest-my_eval:144.429\n",
      "[193]\ttrain-rmse:201.659\ttest-rmse:129.532\ttrain-my_eval:61.8836\ttest-my_eval:144.535\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[194]\ttrain-rmse:201.658\ttest-rmse:129.531\ttrain-my_eval:61.852\ttest-my_eval:144.592\n",
      "[195]\ttrain-rmse:201.656\ttest-rmse:129.529\ttrain-my_eval:61.8126\ttest-my_eval:144.548\n",
      "[196]\ttrain-rmse:201.655\ttest-rmse:129.527\ttrain-my_eval:61.8251\ttest-my_eval:144.679\n",
      "[197]\ttrain-rmse:201.654\ttest-rmse:129.527\ttrain-my_eval:61.7884\ttest-my_eval:144.602\n",
      "[198]\ttrain-rmse:201.652\ttest-rmse:129.525\ttrain-my_eval:61.7936\ttest-my_eval:144.765\n",
      "[199]\ttrain-rmse:201.651\ttest-rmse:129.524\ttrain-my_eval:61.7748\ttest-my_eval:144.775\n",
      "[200]\ttrain-rmse:201.65\ttest-rmse:129.522\ttrain-my_eval:61.7518\ttest-my_eval:144.751\n",
      "[201]\ttrain-rmse:201.648\ttest-rmse:129.52\ttrain-my_eval:61.7399\ttest-my_eval:144.763\n",
      "[202]\ttrain-rmse:201.647\ttest-rmse:129.518\ttrain-my_eval:61.7214\ttest-my_eval:144.809\n",
      "[203]\ttrain-rmse:201.645\ttest-rmse:129.516\ttrain-my_eval:61.7107\ttest-my_eval:144.818\n",
      "[204]\ttrain-rmse:201.644\ttest-rmse:129.515\ttrain-my_eval:61.7005\ttest-my_eval:144.8\n",
      "[205]\ttrain-rmse:201.642\ttest-rmse:129.513\ttrain-my_eval:61.7001\ttest-my_eval:144.788\n",
      "[206]\ttrain-rmse:201.641\ttest-rmse:129.511\ttrain-my_eval:61.6754\ttest-my_eval:144.786\n",
      "[207]\ttrain-rmse:201.64\ttest-rmse:129.509\ttrain-my_eval:61.6562\ttest-my_eval:144.799\n",
      "[208]\ttrain-rmse:201.639\ttest-rmse:129.508\ttrain-my_eval:61.628\ttest-my_eval:144.815\n",
      "[209]\ttrain-rmse:201.637\ttest-rmse:129.506\ttrain-my_eval:61.6152\ttest-my_eval:144.855\n",
      "[210]\ttrain-rmse:201.636\ttest-rmse:129.505\ttrain-my_eval:61.5863\ttest-my_eval:144.78\n",
      "[211]\ttrain-rmse:201.634\ttest-rmse:129.503\ttrain-my_eval:61.576\ttest-my_eval:144.745\n",
      "[212]\ttrain-rmse:201.633\ttest-rmse:129.501\ttrain-my_eval:61.5451\ttest-my_eval:144.759\n",
      "[213]\ttrain-rmse:201.632\ttest-rmse:129.5\ttrain-my_eval:61.5225\ttest-my_eval:144.702\n",
      "[214]\ttrain-rmse:201.631\ttest-rmse:129.498\ttrain-my_eval:61.5128\ttest-my_eval:144.699\n",
      "[215]\ttrain-rmse:201.629\ttest-rmse:129.496\ttrain-my_eval:61.4911\ttest-my_eval:144.707\n",
      "[216]\ttrain-rmse:201.628\ttest-rmse:129.495\ttrain-my_eval:61.4621\ttest-my_eval:144.732\n",
      "[217]\ttrain-rmse:201.627\ttest-rmse:129.493\ttrain-my_eval:61.4579\ttest-my_eval:144.783\n",
      "[218]\ttrain-rmse:201.625\ttest-rmse:129.492\ttrain-my_eval:61.4439\ttest-my_eval:144.783\n",
      "[219]\ttrain-rmse:201.624\ttest-rmse:129.49\ttrain-my_eval:61.4414\ttest-my_eval:144.798\n",
      "[220]\ttrain-rmse:201.622\ttest-rmse:129.488\ttrain-my_eval:61.4302\ttest-my_eval:144.77\n",
      "[221]\ttrain-rmse:201.621\ttest-rmse:129.487\ttrain-my_eval:61.4157\ttest-my_eval:144.718\n",
      "[222]\ttrain-rmse:201.62\ttest-rmse:129.485\ttrain-my_eval:61.4027\ttest-my_eval:144.619\n",
      "[223]\ttrain-rmse:201.619\ttest-rmse:129.485\ttrain-my_eval:61.4042\ttest-my_eval:144.654\n",
      "[224]\ttrain-rmse:201.618\ttest-rmse:129.483\ttrain-my_eval:61.3849\ttest-my_eval:144.631\n",
      "[225]\ttrain-rmse:201.617\ttest-rmse:129.481\ttrain-my_eval:61.3846\ttest-my_eval:144.672\n",
      "[226]\ttrain-rmse:201.616\ttest-rmse:129.48\ttrain-my_eval:61.3632\ttest-my_eval:144.643\n",
      "[227]\ttrain-rmse:201.614\ttest-rmse:129.478\ttrain-my_eval:61.3632\ttest-my_eval:144.756\n",
      "[228]\ttrain-rmse:201.613\ttest-rmse:129.476\ttrain-my_eval:61.3344\ttest-my_eval:144.807\n",
      "[229]\ttrain-rmse:201.612\ttest-rmse:129.475\ttrain-my_eval:61.3266\ttest-my_eval:144.796\n",
      "[230]\ttrain-rmse:201.611\ttest-rmse:129.474\ttrain-my_eval:61.3154\ttest-my_eval:144.744\n",
      "[231]\ttrain-rmse:201.609\ttest-rmse:129.472\ttrain-my_eval:61.3018\ttest-my_eval:144.755\n",
      "[232]\ttrain-rmse:201.607\ttest-rmse:129.47\ttrain-my_eval:61.2899\ttest-my_eval:144.851\n",
      "[233]\ttrain-rmse:201.606\ttest-rmse:129.468\ttrain-my_eval:61.2737\ttest-my_eval:144.8\n",
      "[234]\ttrain-rmse:201.605\ttest-rmse:129.467\ttrain-my_eval:61.2422\ttest-my_eval:144.812\n",
      "[235]\ttrain-rmse:201.604\ttest-rmse:129.466\ttrain-my_eval:61.2258\ttest-my_eval:144.804\n",
      "[236]\ttrain-rmse:201.603\ttest-rmse:129.464\ttrain-my_eval:61.2135\ttest-my_eval:144.82\n",
      "[237]\ttrain-rmse:201.602\ttest-rmse:129.463\ttrain-my_eval:61.1989\ttest-my_eval:144.824\n",
      "[238]\ttrain-rmse:201.601\ttest-rmse:129.462\ttrain-my_eval:61.1834\ttest-my_eval:144.849\n",
      "[239]\ttrain-rmse:201.6\ttest-rmse:129.461\ttrain-my_eval:61.1759\ttest-my_eval:144.811\n",
      "[240]\ttrain-rmse:201.599\ttest-rmse:129.46\ttrain-my_eval:61.1657\ttest-my_eval:144.94\n",
      "[241]\ttrain-rmse:201.598\ttest-rmse:129.459\ttrain-my_eval:61.1434\ttest-my_eval:144.865\n",
      "[242]\ttrain-rmse:201.597\ttest-rmse:129.458\ttrain-my_eval:61.1337\ttest-my_eval:144.873\n",
      "[243]\ttrain-rmse:201.596\ttest-rmse:129.456\ttrain-my_eval:61.1185\ttest-my_eval:144.96\n",
      "[244]\ttrain-rmse:201.595\ttest-rmse:129.454\ttrain-my_eval:61.097\ttest-my_eval:144.872\n",
      "[245]\ttrain-rmse:201.594\ttest-rmse:129.453\ttrain-my_eval:61.0651\ttest-my_eval:144.874\n",
      "[246]\ttrain-rmse:201.592\ttest-rmse:129.451\ttrain-my_eval:61.0631\ttest-my_eval:144.975\n",
      "[247]\ttrain-rmse:201.591\ttest-rmse:129.45\ttrain-my_eval:61.0326\ttest-my_eval:144.958\n",
      "[248]\ttrain-rmse:201.59\ttest-rmse:129.449\ttrain-my_eval:61.0241\ttest-my_eval:144.933\n",
      "[249]\ttrain-rmse:201.588\ttest-rmse:129.447\ttrain-my_eval:61.0048\ttest-my_eval:144.932\n",
      "[250]\ttrain-rmse:201.588\ttest-rmse:129.446\ttrain-my_eval:60.9864\ttest-my_eval:144.906\n",
      "[251]\ttrain-rmse:201.587\ttest-rmse:129.445\ttrain-my_eval:60.973\ttest-my_eval:144.898\n",
      "[252]\ttrain-rmse:201.586\ttest-rmse:129.444\ttrain-my_eval:60.9703\ttest-my_eval:144.956\n",
      "[253]\ttrain-rmse:201.584\ttest-rmse:129.442\ttrain-my_eval:60.9583\ttest-my_eval:145.121\n",
      "[254]\ttrain-rmse:201.583\ttest-rmse:129.441\ttrain-my_eval:60.9437\ttest-my_eval:145.062\n",
      "[255]\ttrain-rmse:201.582\ttest-rmse:129.439\ttrain-my_eval:60.9355\ttest-my_eval:145.131\n",
      "[256]\ttrain-rmse:201.581\ttest-rmse:129.438\ttrain-my_eval:60.9219\ttest-my_eval:145.15\n",
      "[257]\ttrain-rmse:201.58\ttest-rmse:129.437\ttrain-my_eval:60.9062\ttest-my_eval:145.085\n",
      "[258]\ttrain-rmse:201.579\ttest-rmse:129.436\ttrain-my_eval:60.8895\ttest-my_eval:145.187\n",
      "[259]\ttrain-rmse:201.578\ttest-rmse:129.435\ttrain-my_eval:60.8739\ttest-my_eval:145.148\n",
      "[260]\ttrain-rmse:201.577\ttest-rmse:129.434\ttrain-my_eval:60.8655\ttest-my_eval:145.16\n",
      "[261]\ttrain-rmse:201.577\ttest-rmse:129.433\ttrain-my_eval:60.8396\ttest-my_eval:145.153\n",
      "[262]\ttrain-rmse:201.575\ttest-rmse:129.431\ttrain-my_eval:60.8418\ttest-my_eval:145.265\n",
      "[263]\ttrain-rmse:201.574\ttest-rmse:129.43\ttrain-my_eval:60.8348\ttest-my_eval:145.249\n",
      "[264]\ttrain-rmse:201.573\ttest-rmse:129.429\ttrain-my_eval:60.826\ttest-my_eval:145.262\n",
      "[265]\ttrain-rmse:201.572\ttest-rmse:129.427\ttrain-my_eval:60.8216\ttest-my_eval:145.283\n",
      "[266]\ttrain-rmse:201.571\ttest-rmse:129.425\ttrain-my_eval:60.8129\ttest-my_eval:145.351\n",
      "[267]\ttrain-rmse:201.569\ttest-rmse:129.423\ttrain-my_eval:60.8043\ttest-my_eval:145.352\n",
      "[268]\ttrain-rmse:201.568\ttest-rmse:129.422\ttrain-my_eval:60.7932\ttest-my_eval:145.331\n",
      "[269]\ttrain-rmse:201.568\ttest-rmse:129.422\ttrain-my_eval:60.7774\ttest-my_eval:145.344\n",
      "[270]\ttrain-rmse:201.566\ttest-rmse:129.42\ttrain-my_eval:60.7744\ttest-my_eval:145.331\n",
      "[271]\ttrain-rmse:201.565\ttest-rmse:129.419\ttrain-my_eval:60.7608\ttest-my_eval:145.277\n",
      "[272]\ttrain-rmse:201.564\ttest-rmse:129.418\ttrain-my_eval:60.7534\ttest-my_eval:145.243\n",
      "[273]\ttrain-rmse:201.563\ttest-rmse:129.417\ttrain-my_eval:60.755\ttest-my_eval:145.28\n",
      "[274]\ttrain-rmse:201.563\ttest-rmse:129.416\ttrain-my_eval:60.7328\ttest-my_eval:145.27\n",
      "[275]\ttrain-rmse:201.561\ttest-rmse:129.414\ttrain-my_eval:60.7321\ttest-my_eval:145.384\n",
      "[276]\ttrain-rmse:201.56\ttest-rmse:129.413\ttrain-my_eval:60.7167\ttest-my_eval:145.431\n",
      "[277]\ttrain-rmse:201.559\ttest-rmse:129.413\ttrain-my_eval:60.7119\ttest-my_eval:145.412\n",
      "[278]\ttrain-rmse:201.558\ttest-rmse:129.411\ttrain-my_eval:60.685\ttest-my_eval:145.347\n",
      "[279]\ttrain-rmse:201.557\ttest-rmse:129.41\ttrain-my_eval:60.6539\ttest-my_eval:145.328\n",
      "[280]\ttrain-rmse:201.556\ttest-rmse:129.409\ttrain-my_eval:60.6301\ttest-my_eval:145.269\n",
      "[281]\ttrain-rmse:201.554\ttest-rmse:129.407\ttrain-my_eval:60.6339\ttest-my_eval:145.319\n",
      "[282]\ttrain-rmse:201.554\ttest-rmse:129.406\ttrain-my_eval:60.6086\ttest-my_eval:145.32\n",
      "[283]\ttrain-rmse:201.553\ttest-rmse:129.405\ttrain-my_eval:60.5916\ttest-my_eval:145.228\n",
      "[284]\ttrain-rmse:201.552\ttest-rmse:129.404\ttrain-my_eval:60.586\ttest-my_eval:145.221\n",
      "[285]\ttrain-rmse:201.551\ttest-rmse:129.403\ttrain-my_eval:60.5937\ttest-my_eval:145.232\n",
      "[286]\ttrain-rmse:201.55\ttest-rmse:129.402\ttrain-my_eval:60.5987\ttest-my_eval:145.352\n",
      "[287]\ttrain-rmse:201.549\ttest-rmse:129.401\ttrain-my_eval:60.5903\ttest-my_eval:145.335\n",
      "[288]\ttrain-rmse:201.548\ttest-rmse:129.4\ttrain-my_eval:60.5766\ttest-my_eval:145.271\n",
      "[289]\ttrain-rmse:201.548\ttest-rmse:129.399\ttrain-my_eval:60.5719\ttest-my_eval:145.27\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[290]\ttrain-rmse:201.547\ttest-rmse:129.399\ttrain-my_eval:60.5612\ttest-my_eval:145.274\n",
      "[291]\ttrain-rmse:201.545\ttest-rmse:129.397\ttrain-my_eval:60.5567\ttest-my_eval:145.352\n",
      "[292]\ttrain-rmse:201.545\ttest-rmse:129.396\ttrain-my_eval:60.5446\ttest-my_eval:145.314\n",
      "[293]\ttrain-rmse:201.544\ttest-rmse:129.395\ttrain-my_eval:60.5179\ttest-my_eval:145.503\n",
      "[294]\ttrain-rmse:201.542\ttest-rmse:129.394\ttrain-my_eval:60.5171\ttest-my_eval:145.521\n",
      "[295]\ttrain-rmse:201.542\ttest-rmse:129.393\ttrain-my_eval:60.4968\ttest-my_eval:145.558\n",
      "[296]\ttrain-rmse:201.54\ttest-rmse:129.391\ttrain-my_eval:60.4857\ttest-my_eval:145.714\n",
      "[297]\ttrain-rmse:201.539\ttest-rmse:129.39\ttrain-my_eval:60.4539\ttest-my_eval:145.676\n",
      "[298]\ttrain-rmse:201.538\ttest-rmse:129.388\ttrain-my_eval:60.4548\ttest-my_eval:145.774\n",
      "[299]\ttrain-rmse:201.537\ttest-rmse:129.387\ttrain-my_eval:60.4425\ttest-my_eval:145.761\n",
      "[300]\ttrain-rmse:201.536\ttest-rmse:129.386\ttrain-my_eval:60.4193\ttest-my_eval:145.737\n",
      "[301]\ttrain-rmse:201.535\ttest-rmse:129.385\ttrain-my_eval:60.4225\ttest-my_eval:145.821\n",
      "[302]\ttrain-rmse:201.534\ttest-rmse:129.383\ttrain-my_eval:60.4226\ttest-my_eval:145.898\n",
      "[303]\ttrain-rmse:201.533\ttest-rmse:129.382\ttrain-my_eval:60.4168\ttest-my_eval:145.832\n",
      "[304]\ttrain-rmse:201.532\ttest-rmse:129.381\ttrain-my_eval:60.4062\ttest-my_eval:145.815\n",
      "[305]\ttrain-rmse:201.531\ttest-rmse:129.38\ttrain-my_eval:60.3912\ttest-my_eval:145.799\n",
      "[306]\ttrain-rmse:201.53\ttest-rmse:129.378\ttrain-my_eval:60.3833\ttest-my_eval:145.79\n",
      "[307]\ttrain-rmse:201.528\ttest-rmse:129.377\ttrain-my_eval:60.3743\ttest-my_eval:145.759\n",
      "[308]\ttrain-rmse:201.528\ttest-rmse:129.376\ttrain-my_eval:60.3535\ttest-my_eval:145.712\n",
      "[309]\ttrain-rmse:201.527\ttest-rmse:129.375\ttrain-my_eval:60.3411\ttest-my_eval:145.715\n",
      "[310]\ttrain-rmse:201.526\ttest-rmse:129.373\ttrain-my_eval:60.3263\ttest-my_eval:145.693\n",
      "[311]\ttrain-rmse:201.525\ttest-rmse:129.372\ttrain-my_eval:60.3283\ttest-my_eval:145.701\n",
      "[312]\ttrain-rmse:201.524\ttest-rmse:129.371\ttrain-my_eval:60.3199\ttest-my_eval:145.694\n",
      "[313]\ttrain-rmse:201.523\ttest-rmse:129.37\ttrain-my_eval:60.3064\ttest-my_eval:145.697\n",
      "[314]\ttrain-rmse:201.522\ttest-rmse:129.369\ttrain-my_eval:60.2861\ttest-my_eval:145.697\n",
      "[315]\ttrain-rmse:201.52\ttest-rmse:129.367\ttrain-my_eval:60.2863\ttest-my_eval:145.698\n",
      "[316]\ttrain-rmse:201.519\ttest-rmse:129.366\ttrain-my_eval:60.2705\ttest-my_eval:145.883\n",
      "[317]\ttrain-rmse:201.518\ttest-rmse:129.365\ttrain-my_eval:60.2532\ttest-my_eval:145.982\n",
      "[318]\ttrain-rmse:201.518\ttest-rmse:129.365\ttrain-my_eval:60.2355\ttest-my_eval:145.975\n",
      "[319]\ttrain-rmse:201.517\ttest-rmse:129.364\ttrain-my_eval:60.2169\ttest-my_eval:145.997\n",
      "[320]\ttrain-rmse:201.516\ttest-rmse:129.363\ttrain-my_eval:60.202\ttest-my_eval:146.002\n",
      "[321]\ttrain-rmse:201.515\ttest-rmse:129.361\ttrain-my_eval:60.1944\ttest-my_eval:145.953\n",
      "[322]\ttrain-rmse:201.514\ttest-rmse:129.36\ttrain-my_eval:60.192\ttest-my_eval:145.972\n",
      "[323]\ttrain-rmse:201.514\ttest-rmse:129.36\ttrain-my_eval:60.1802\ttest-my_eval:145.953\n",
      "[324]\ttrain-rmse:201.513\ttest-rmse:129.359\ttrain-my_eval:60.1709\ttest-my_eval:145.918\n",
      "[325]\ttrain-rmse:201.512\ttest-rmse:129.357\ttrain-my_eval:60.1676\ttest-my_eval:145.926\n",
      "[326]\ttrain-rmse:201.511\ttest-rmse:129.356\ttrain-my_eval:60.1538\ttest-my_eval:145.921\n",
      "[327]\ttrain-rmse:201.51\ttest-rmse:129.355\ttrain-my_eval:60.1502\ttest-my_eval:145.935\n",
      "[328]\ttrain-rmse:201.509\ttest-rmse:129.354\ttrain-my_eval:60.1442\ttest-my_eval:146.025\n",
      "[329]\ttrain-rmse:201.508\ttest-rmse:129.352\ttrain-my_eval:60.1322\ttest-my_eval:146.012\n",
      "[330]\ttrain-rmse:201.507\ttest-rmse:129.351\ttrain-my_eval:60.1163\ttest-my_eval:146.016\n",
      "[331]\ttrain-rmse:201.506\ttest-rmse:129.35\ttrain-my_eval:60.1044\ttest-my_eval:146.027\n",
      "[332]\ttrain-rmse:201.505\ttest-rmse:129.349\ttrain-my_eval:60.1154\ttest-my_eval:146.017\n",
      "[333]\ttrain-rmse:201.504\ttest-rmse:129.348\ttrain-my_eval:60.1082\ttest-my_eval:145.959\n",
      "[334]\ttrain-rmse:201.503\ttest-rmse:129.347\ttrain-my_eval:60.0815\ttest-my_eval:145.903\n",
      "[335]\ttrain-rmse:201.503\ttest-rmse:129.346\ttrain-my_eval:60.073\ttest-my_eval:145.846\n",
      "[336]\ttrain-rmse:201.502\ttest-rmse:129.344\ttrain-my_eval:60.0663\ttest-my_eval:145.858\n",
      "[337]\ttrain-rmse:201.501\ttest-rmse:129.344\ttrain-my_eval:60.044\ttest-my_eval:145.815\n",
      "[338]\ttrain-rmse:201.5\ttest-rmse:129.345\ttrain-my_eval:60.0169\ttest-my_eval:145.797\n",
      "[339]\ttrain-rmse:201.499\ttest-rmse:129.344\ttrain-my_eval:59.9874\ttest-my_eval:145.766\n",
      "[340]\ttrain-rmse:201.498\ttest-rmse:129.343\ttrain-my_eval:59.9794\ttest-my_eval:145.777\n",
      "[341]\ttrain-rmse:201.497\ttest-rmse:129.341\ttrain-my_eval:59.9609\ttest-my_eval:145.759\n",
      "[342]\ttrain-rmse:201.496\ttest-rmse:129.34\ttrain-my_eval:59.952\ttest-my_eval:145.729\n",
      "[343]\ttrain-rmse:201.495\ttest-rmse:129.339\ttrain-my_eval:59.9467\ttest-my_eval:145.705\n",
      "[344]\ttrain-rmse:201.494\ttest-rmse:129.338\ttrain-my_eval:59.9551\ttest-my_eval:145.743\n",
      "[345]\ttrain-rmse:201.493\ttest-rmse:129.336\ttrain-my_eval:59.9602\ttest-my_eval:145.797\n",
      "[346]\ttrain-rmse:201.492\ttest-rmse:129.335\ttrain-my_eval:59.9397\ttest-my_eval:145.744\n",
      "[347]\ttrain-rmse:201.491\ttest-rmse:129.334\ttrain-my_eval:59.9355\ttest-my_eval:145.846\n",
      "[348]\ttrain-rmse:201.49\ttest-rmse:129.333\ttrain-my_eval:59.9097\ttest-my_eval:145.787\n",
      "[349]\ttrain-rmse:201.489\ttest-rmse:129.331\ttrain-my_eval:59.911\ttest-my_eval:145.82\n",
      "[350]\ttrain-rmse:201.488\ttest-rmse:129.33\ttrain-my_eval:59.9221\ttest-my_eval:145.95\n",
      "[351]\ttrain-rmse:201.487\ttest-rmse:129.329\ttrain-my_eval:59.9102\ttest-my_eval:145.899\n",
      "[352]\ttrain-rmse:201.486\ttest-rmse:129.328\ttrain-my_eval:59.897\ttest-my_eval:145.953\n",
      "[353]\ttrain-rmse:201.485\ttest-rmse:129.327\ttrain-my_eval:59.8851\ttest-my_eval:145.924\n",
      "[354]\ttrain-rmse:201.484\ttest-rmse:129.326\ttrain-my_eval:59.8867\ttest-my_eval:145.975\n",
      "[355]\ttrain-rmse:201.483\ttest-rmse:129.325\ttrain-my_eval:59.8698\ttest-my_eval:145.981\n",
      "[356]\ttrain-rmse:201.482\ttest-rmse:129.324\ttrain-my_eval:59.8648\ttest-my_eval:145.992\n",
      "[357]\ttrain-rmse:201.481\ttest-rmse:129.322\ttrain-my_eval:59.8512\ttest-my_eval:145.989\n",
      "[358]\ttrain-rmse:201.48\ttest-rmse:129.321\ttrain-my_eval:59.8429\ttest-my_eval:145.967\n",
      "[359]\ttrain-rmse:201.479\ttest-rmse:129.32\ttrain-my_eval:59.839\ttest-my_eval:145.995\n",
      "[360]\ttrain-rmse:201.478\ttest-rmse:129.319\ttrain-my_eval:59.8295\ttest-my_eval:145.976\n",
      "[361]\ttrain-rmse:201.478\ttest-rmse:129.318\ttrain-my_eval:59.8127\ttest-my_eval:145.963\n",
      "[362]\ttrain-rmse:201.477\ttest-rmse:129.317\ttrain-my_eval:59.7925\ttest-my_eval:145.912\n",
      "[363]\ttrain-rmse:201.476\ttest-rmse:129.316\ttrain-my_eval:59.7968\ttest-my_eval:145.985\n",
      "[364]\ttrain-rmse:201.475\ttest-rmse:129.315\ttrain-my_eval:59.7803\ttest-my_eval:145.993\n",
      "[365]\ttrain-rmse:201.474\ttest-rmse:129.315\ttrain-my_eval:59.7604\ttest-my_eval:145.952\n",
      "[366]\ttrain-rmse:201.474\ttest-rmse:129.314\ttrain-my_eval:59.7509\ttest-my_eval:146.039\n",
      "[367]\ttrain-rmse:201.473\ttest-rmse:129.314\ttrain-my_eval:59.7454\ttest-my_eval:145.998\n",
      "[368]\ttrain-rmse:201.472\ttest-rmse:129.312\ttrain-my_eval:59.7191\ttest-my_eval:145.945\n",
      "[369]\ttrain-rmse:201.471\ttest-rmse:129.311\ttrain-my_eval:59.7082\ttest-my_eval:145.912\n",
      "[370]\ttrain-rmse:201.47\ttest-rmse:129.31\ttrain-my_eval:59.691\ttest-my_eval:145.953\n",
      "[371]\ttrain-rmse:201.469\ttest-rmse:129.309\ttrain-my_eval:59.6932\ttest-my_eval:145.968\n",
      "[372]\ttrain-rmse:201.469\ttest-rmse:129.308\ttrain-my_eval:59.6925\ttest-my_eval:145.98\n",
      "[373]\ttrain-rmse:201.467\ttest-rmse:129.307\ttrain-my_eval:59.6955\ttest-my_eval:145.988\n",
      "[374]\ttrain-rmse:201.467\ttest-rmse:129.306\ttrain-my_eval:59.6867\ttest-my_eval:145.977\n",
      "[375]\ttrain-rmse:201.466\ttest-rmse:129.305\ttrain-my_eval:59.683\ttest-my_eval:145.931\n",
      "[376]\ttrain-rmse:201.465\ttest-rmse:129.304\ttrain-my_eval:59.6829\ttest-my_eval:145.931\n",
      "[377]\ttrain-rmse:201.464\ttest-rmse:129.303\ttrain-my_eval:59.6765\ttest-my_eval:146.003\n",
      "[378]\ttrain-rmse:201.463\ttest-rmse:129.302\ttrain-my_eval:59.6734\ttest-my_eval:145.997\n",
      "[379]\ttrain-rmse:201.462\ttest-rmse:129.301\ttrain-my_eval:59.6519\ttest-my_eval:146.051\n",
      "[380]\ttrain-rmse:201.462\ttest-rmse:129.3\ttrain-my_eval:59.6468\ttest-my_eval:146.049\n",
      "[381]\ttrain-rmse:201.461\ttest-rmse:129.3\ttrain-my_eval:59.6419\ttest-my_eval:146.065\n",
      "[382]\ttrain-rmse:201.46\ttest-rmse:129.298\ttrain-my_eval:59.6088\ttest-my_eval:146.08\n",
      "[383]\ttrain-rmse:201.459\ttest-rmse:129.297\ttrain-my_eval:59.6048\ttest-my_eval:146.033\n",
      "[384]\ttrain-rmse:201.458\ttest-rmse:129.297\ttrain-my_eval:59.5996\ttest-my_eval:146.02\n",
      "[385]\ttrain-rmse:201.458\ttest-rmse:129.296\ttrain-my_eval:59.5885\ttest-my_eval:145.963\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[386]\ttrain-rmse:201.457\ttest-rmse:129.295\ttrain-my_eval:59.5917\ttest-my_eval:145.999\n",
      "[387]\ttrain-rmse:201.456\ttest-rmse:129.293\ttrain-my_eval:59.5855\ttest-my_eval:146.002\n",
      "[388]\ttrain-rmse:201.455\ttest-rmse:129.292\ttrain-my_eval:59.5881\ttest-my_eval:146.095\n",
      "[389]\ttrain-rmse:201.454\ttest-rmse:129.291\ttrain-my_eval:59.5757\ttest-my_eval:146.063\n",
      "[390]\ttrain-rmse:201.453\ttest-rmse:129.29\ttrain-my_eval:59.5614\ttest-my_eval:145.995\n",
      "[391]\ttrain-rmse:201.452\ttest-rmse:129.288\ttrain-my_eval:59.5654\ttest-my_eval:146.065\n",
      "[392]\ttrain-rmse:201.451\ttest-rmse:129.288\ttrain-my_eval:59.5508\ttest-my_eval:146.054\n",
      "[393]\ttrain-rmse:201.451\ttest-rmse:129.287\ttrain-my_eval:59.5289\ttest-my_eval:145.992\n",
      "[394]\ttrain-rmse:201.45\ttest-rmse:129.286\ttrain-my_eval:59.5171\ttest-my_eval:145.949\n",
      "[395]\ttrain-rmse:201.449\ttest-rmse:129.285\ttrain-my_eval:59.5092\ttest-my_eval:145.983\n",
      "[396]\ttrain-rmse:201.448\ttest-rmse:129.283\ttrain-my_eval:59.4954\ttest-my_eval:145.928\n",
      "[397]\ttrain-rmse:201.447\ttest-rmse:129.282\ttrain-my_eval:59.4948\ttest-my_eval:145.94\n",
      "[398]\ttrain-rmse:201.446\ttest-rmse:129.281\ttrain-my_eval:59.4679\ttest-my_eval:145.92\n",
      "[399]\ttrain-rmse:201.445\ttest-rmse:129.281\ttrain-my_eval:59.4519\ttest-my_eval:145.91\n",
      "[400]\ttrain-rmse:201.445\ttest-rmse:129.28\ttrain-my_eval:59.4514\ttest-my_eval:145.925\n",
      "[401]\ttrain-rmse:201.444\ttest-rmse:129.279\ttrain-my_eval:59.4576\ttest-my_eval:146.034\n",
      "[402]\ttrain-rmse:201.443\ttest-rmse:129.278\ttrain-my_eval:59.4247\ttest-my_eval:145.921\n",
      "[403]\ttrain-rmse:201.442\ttest-rmse:129.277\ttrain-my_eval:59.4049\ttest-my_eval:145.974\n",
      "[404]\ttrain-rmse:201.441\ttest-rmse:129.276\ttrain-my_eval:59.3996\ttest-my_eval:145.963\n",
      "[405]\ttrain-rmse:201.44\ttest-rmse:129.275\ttrain-my_eval:59.3933\ttest-my_eval:145.982\n",
      "[406]\ttrain-rmse:201.439\ttest-rmse:129.273\ttrain-my_eval:59.39\ttest-my_eval:146.026\n",
      "[407]\ttrain-rmse:201.438\ttest-rmse:129.272\ttrain-my_eval:59.3948\ttest-my_eval:146.084\n",
      "[408]\ttrain-rmse:201.437\ttest-rmse:129.271\ttrain-my_eval:59.3732\ttest-my_eval:146.023\n",
      "[409]\ttrain-rmse:201.437\ttest-rmse:129.27\ttrain-my_eval:59.3745\ttest-my_eval:146.043\n",
      "[410]\ttrain-rmse:201.436\ttest-rmse:129.27\ttrain-my_eval:59.3757\ttest-my_eval:146.077\n",
      "[411]\ttrain-rmse:201.435\ttest-rmse:129.268\ttrain-my_eval:59.3727\ttest-my_eval:146.064\n",
      "[412]\ttrain-rmse:201.435\ttest-rmse:129.268\ttrain-my_eval:59.3537\ttest-my_eval:146.167\n",
      "[413]\ttrain-rmse:201.434\ttest-rmse:129.267\ttrain-my_eval:59.3387\ttest-my_eval:146.139\n",
      "[414]\ttrain-rmse:201.433\ttest-rmse:129.266\ttrain-my_eval:59.3261\ttest-my_eval:146.137\n",
      "[415]\ttrain-rmse:201.432\ttest-rmse:129.265\ttrain-my_eval:59.3391\ttest-my_eval:146.16\n",
      "[416]\ttrain-rmse:201.432\ttest-rmse:129.264\ttrain-my_eval:59.3319\ttest-my_eval:146.214\n",
      "[417]\ttrain-rmse:201.431\ttest-rmse:129.264\ttrain-my_eval:59.3284\ttest-my_eval:146.171\n",
      "[418]\ttrain-rmse:201.431\ttest-rmse:129.263\ttrain-my_eval:59.3219\ttest-my_eval:146.132\n",
      "[419]\ttrain-rmse:201.43\ttest-rmse:129.263\ttrain-my_eval:59.3177\ttest-my_eval:146.107\n",
      "[420]\ttrain-rmse:201.43\ttest-rmse:129.262\ttrain-my_eval:59.3176\ttest-my_eval:146.07\n",
      "[421]\ttrain-rmse:201.429\ttest-rmse:129.261\ttrain-my_eval:59.3036\ttest-my_eval:146.061\n",
      "[422]\ttrain-rmse:201.428\ttest-rmse:129.26\ttrain-my_eval:59.3057\ttest-my_eval:146.109\n",
      "[423]\ttrain-rmse:201.427\ttest-rmse:129.259\ttrain-my_eval:59.2894\ttest-my_eval:146.099\n",
      "[424]\ttrain-rmse:201.426\ttest-rmse:129.258\ttrain-my_eval:59.2778\ttest-my_eval:146.097\n",
      "[425]\ttrain-rmse:201.425\ttest-rmse:129.257\ttrain-my_eval:59.2634\ttest-my_eval:146.043\n",
      "[426]\ttrain-rmse:201.424\ttest-rmse:129.256\ttrain-my_eval:59.2447\ttest-my_eval:146.045\n",
      "[427]\ttrain-rmse:201.423\ttest-rmse:129.254\ttrain-my_eval:59.228\ttest-my_eval:146.062\n",
      "[428]\ttrain-rmse:201.423\ttest-rmse:129.254\ttrain-my_eval:59.2201\ttest-my_eval:146.048\n",
      "[429]\ttrain-rmse:201.422\ttest-rmse:129.252\ttrain-my_eval:59.2194\ttest-my_eval:146.059\n",
      "[430]\ttrain-rmse:201.421\ttest-rmse:129.252\ttrain-my_eval:59.2169\ttest-my_eval:146.041\n",
      "[431]\ttrain-rmse:201.42\ttest-rmse:129.251\ttrain-my_eval:59.2234\ttest-my_eval:146.069\n",
      "[432]\ttrain-rmse:201.42\ttest-rmse:129.25\ttrain-my_eval:59.1868\ttest-my_eval:146.254\n",
      "[433]\ttrain-rmse:201.419\ttest-rmse:129.249\ttrain-my_eval:59.1744\ttest-my_eval:146.216\n",
      "[434]\ttrain-rmse:201.418\ttest-rmse:129.249\ttrain-my_eval:59.1561\ttest-my_eval:146.155\n",
      "[435]\ttrain-rmse:201.418\ttest-rmse:129.248\ttrain-my_eval:59.1505\ttest-my_eval:146.254\n",
      "[436]\ttrain-rmse:201.417\ttest-rmse:129.248\ttrain-my_eval:59.1444\ttest-my_eval:146.259\n",
      "[437]\ttrain-rmse:201.417\ttest-rmse:129.248\ttrain-my_eval:59.1371\ttest-my_eval:146.257\n",
      "[438]\ttrain-rmse:201.416\ttest-rmse:129.247\ttrain-my_eval:59.1358\ttest-my_eval:146.213\n",
      "[439]\ttrain-rmse:201.415\ttest-rmse:129.246\ttrain-my_eval:59.1317\ttest-my_eval:146.225\n",
      "[440]\ttrain-rmse:201.414\ttest-rmse:129.245\ttrain-my_eval:59.1347\ttest-my_eval:146.253\n",
      "[441]\ttrain-rmse:201.414\ttest-rmse:129.245\ttrain-my_eval:59.1332\ttest-my_eval:146.279\n",
      "[442]\ttrain-rmse:201.413\ttest-rmse:129.244\ttrain-my_eval:59.1222\ttest-my_eval:146.277\n",
      "[443]\ttrain-rmse:201.412\ttest-rmse:129.243\ttrain-my_eval:59.1147\ttest-my_eval:146.279\n",
      "[444]\ttrain-rmse:201.411\ttest-rmse:129.242\ttrain-my_eval:59.1074\ttest-my_eval:146.27\n",
      "[445]\ttrain-rmse:201.411\ttest-rmse:129.241\ttrain-my_eval:59.0911\ttest-my_eval:146.229\n",
      "[446]\ttrain-rmse:201.41\ttest-rmse:129.24\ttrain-my_eval:59.0895\ttest-my_eval:146.366\n",
      "[447]\ttrain-rmse:201.409\ttest-rmse:129.239\ttrain-my_eval:59.0935\ttest-my_eval:146.37\n",
      "[448]\ttrain-rmse:201.408\ttest-rmse:129.238\ttrain-my_eval:59.0905\ttest-my_eval:146.359\n",
      "[449]\ttrain-rmse:201.408\ttest-rmse:129.237\ttrain-my_eval:59.0837\ttest-my_eval:146.351\n",
      "[450]\ttrain-rmse:201.407\ttest-rmse:129.237\ttrain-my_eval:59.0681\ttest-my_eval:146.266\n",
      "[451]\ttrain-rmse:201.406\ttest-rmse:129.236\ttrain-my_eval:59.0578\ttest-my_eval:146.252\n",
      "[452]\ttrain-rmse:201.406\ttest-rmse:129.235\ttrain-my_eval:59.0454\ttest-my_eval:146.225\n",
      "[453]\ttrain-rmse:201.405\ttest-rmse:129.234\ttrain-my_eval:59.0305\ttest-my_eval:146.172\n",
      "[454]\ttrain-rmse:201.404\ttest-rmse:129.233\ttrain-my_eval:59.0211\ttest-my_eval:146.186\n",
      "[455]\ttrain-rmse:201.403\ttest-rmse:129.232\ttrain-my_eval:59.02\ttest-my_eval:146.315\n",
      "[456]\ttrain-rmse:201.402\ttest-rmse:129.231\ttrain-my_eval:59.0095\ttest-my_eval:146.304\n",
      "[457]\ttrain-rmse:201.401\ttest-rmse:129.23\ttrain-my_eval:59.0018\ttest-my_eval:146.316\n",
      "[458]\ttrain-rmse:201.4\ttest-rmse:129.229\ttrain-my_eval:58.9932\ttest-my_eval:146.333\n",
      "[459]\ttrain-rmse:201.4\ttest-rmse:129.229\ttrain-my_eval:58.9767\ttest-my_eval:146.36\n",
      "[460]\ttrain-rmse:201.399\ttest-rmse:129.228\ttrain-my_eval:58.9646\ttest-my_eval:146.338\n",
      "[461]\ttrain-rmse:201.398\ttest-rmse:129.227\ttrain-my_eval:58.9518\ttest-my_eval:146.378\n",
      "[462]\ttrain-rmse:201.397\ttest-rmse:129.226\ttrain-my_eval:58.9449\ttest-my_eval:146.504\n",
      "[463]\ttrain-rmse:201.397\ttest-rmse:129.225\ttrain-my_eval:58.9338\ttest-my_eval:146.492\n",
      "[464]\ttrain-rmse:201.396\ttest-rmse:129.225\ttrain-my_eval:58.9239\ttest-my_eval:146.495\n",
      "[465]\ttrain-rmse:201.396\ttest-rmse:129.224\ttrain-my_eval:58.9216\ttest-my_eval:146.491\n",
      "[466]\ttrain-rmse:201.395\ttest-rmse:129.223\ttrain-my_eval:58.9104\ttest-my_eval:146.489\n",
      "[467]\ttrain-rmse:201.394\ttest-rmse:129.222\ttrain-my_eval:58.9125\ttest-my_eval:146.57\n",
      "[468]\ttrain-rmse:201.393\ttest-rmse:129.222\ttrain-my_eval:58.9135\ttest-my_eval:146.591\n",
      "[469]\ttrain-rmse:201.393\ttest-rmse:129.221\ttrain-my_eval:58.8979\ttest-my_eval:146.611\n",
      "[470]\ttrain-rmse:201.392\ttest-rmse:129.22\ttrain-my_eval:58.8989\ttest-my_eval:146.634\n",
      "[471]\ttrain-rmse:201.391\ttest-rmse:129.22\ttrain-my_eval:58.8922\ttest-my_eval:146.611\n",
      "[472]\ttrain-rmse:201.39\ttest-rmse:129.219\ttrain-my_eval:58.8792\ttest-my_eval:146.597\n",
      "[473]\ttrain-rmse:201.39\ttest-rmse:129.218\ttrain-my_eval:58.8734\ttest-my_eval:146.551\n",
      "[474]\ttrain-rmse:201.389\ttest-rmse:129.217\ttrain-my_eval:58.8759\ttest-my_eval:146.646\n",
      "[475]\ttrain-rmse:201.388\ttest-rmse:129.216\ttrain-my_eval:58.8583\ttest-my_eval:146.892\n",
      "[476]\ttrain-rmse:201.388\ttest-rmse:129.215\ttrain-my_eval:58.8375\ttest-my_eval:146.869\n",
      "[477]\ttrain-rmse:201.387\ttest-rmse:129.215\ttrain-my_eval:58.8325\ttest-my_eval:146.859\n",
      "[478]\ttrain-rmse:201.386\ttest-rmse:129.214\ttrain-my_eval:58.8309\ttest-my_eval:146.854\n",
      "[479]\ttrain-rmse:201.386\ttest-rmse:129.213\ttrain-my_eval:58.8093\ttest-my_eval:146.879\n",
      "[480]\ttrain-rmse:201.386\ttest-rmse:129.213\ttrain-my_eval:58.7972\ttest-my_eval:146.875\n",
      "[481]\ttrain-rmse:201.385\ttest-rmse:129.212\ttrain-my_eval:58.79\ttest-my_eval:146.855\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[482]\ttrain-rmse:201.384\ttest-rmse:129.211\ttrain-my_eval:58.8009\ttest-my_eval:146.942\n",
      "[483]\ttrain-rmse:201.383\ttest-rmse:129.21\ttrain-my_eval:58.813\ttest-my_eval:146.963\n",
      "[484]\ttrain-rmse:201.382\ttest-rmse:129.209\ttrain-my_eval:58.813\ttest-my_eval:146.975\n",
      "[485]\ttrain-rmse:201.382\ttest-rmse:129.208\ttrain-my_eval:58.8114\ttest-my_eval:147.021\n",
      "[486]\ttrain-rmse:201.382\ttest-rmse:129.208\ttrain-my_eval:58.8084\ttest-my_eval:146.977\n",
      "[487]\ttrain-rmse:201.381\ttest-rmse:129.207\ttrain-my_eval:58.8072\ttest-my_eval:146.982\n",
      "[488]\ttrain-rmse:201.38\ttest-rmse:129.207\ttrain-my_eval:58.8099\ttest-my_eval:146.994\n",
      "[489]\ttrain-rmse:201.38\ttest-rmse:129.206\ttrain-my_eval:58.8042\ttest-my_eval:146.988\n",
      "[490]\ttrain-rmse:201.379\ttest-rmse:129.206\ttrain-my_eval:58.7854\ttest-my_eval:146.943\n",
      "[491]\ttrain-rmse:201.379\ttest-rmse:129.206\ttrain-my_eval:58.7704\ttest-my_eval:146.906\n",
      "[492]\ttrain-rmse:201.378\ttest-rmse:129.205\ttrain-my_eval:58.7635\ttest-my_eval:147.036\n",
      "[493]\ttrain-rmse:201.377\ttest-rmse:129.205\ttrain-my_eval:58.7668\ttest-my_eval:147.065\n",
      "[494]\ttrain-rmse:201.377\ttest-rmse:129.203\ttrain-my_eval:58.7715\ttest-my_eval:147.074\n",
      "[495]\ttrain-rmse:201.376\ttest-rmse:129.202\ttrain-my_eval:58.7595\ttest-my_eval:147.044\n",
      "[496]\ttrain-rmse:201.375\ttest-rmse:129.201\ttrain-my_eval:58.7521\ttest-my_eval:147.042\n",
      "[497]\ttrain-rmse:201.374\ttest-rmse:129.201\ttrain-my_eval:58.7485\ttest-my_eval:147.047\n",
      "[498]\ttrain-rmse:201.373\ttest-rmse:129.2\ttrain-my_eval:58.7499\ttest-my_eval:147.071\n",
      "[499]\ttrain-rmse:201.373\ttest-rmse:129.199\ttrain-my_eval:58.7315\ttest-my_eval:147.045\n",
      "[500]\ttrain-rmse:201.372\ttest-rmse:129.198\ttrain-my_eval:58.7161\ttest-my_eval:147.023\n",
      "[501]\ttrain-rmse:201.372\ttest-rmse:129.197\ttrain-my_eval:58.7127\ttest-my_eval:147.04\n",
      "[502]\ttrain-rmse:201.371\ttest-rmse:129.197\ttrain-my_eval:58.7083\ttest-my_eval:147.027\n",
      "[503]\ttrain-rmse:201.371\ttest-rmse:129.196\ttrain-my_eval:58.7012\ttest-my_eval:146.976\n",
      "[504]\ttrain-rmse:201.37\ttest-rmse:129.195\ttrain-my_eval:58.6852\ttest-my_eval:146.984\n",
      "[505]\ttrain-rmse:201.369\ttest-rmse:129.194\ttrain-my_eval:58.6748\ttest-my_eval:146.987\n",
      "[506]\ttrain-rmse:201.368\ttest-rmse:129.193\ttrain-my_eval:58.6789\ttest-my_eval:147.032\n",
      "[507]\ttrain-rmse:201.368\ttest-rmse:129.192\ttrain-my_eval:58.6759\ttest-my_eval:147.186\n",
      "[508]\ttrain-rmse:201.367\ttest-rmse:129.191\ttrain-my_eval:58.6686\ttest-my_eval:147.184\n",
      "[509]\ttrain-rmse:201.366\ttest-rmse:129.191\ttrain-my_eval:58.6532\ttest-my_eval:147.184\n",
      "[510]\ttrain-rmse:201.366\ttest-rmse:129.19\ttrain-my_eval:58.641\ttest-my_eval:147.14\n",
      "[511]\ttrain-rmse:201.365\ttest-rmse:129.189\ttrain-my_eval:58.6243\ttest-my_eval:147.119\n",
      "[512]\ttrain-rmse:201.364\ttest-rmse:129.188\ttrain-my_eval:58.6185\ttest-my_eval:147.116\n",
      "[513]\ttrain-rmse:201.363\ttest-rmse:129.187\ttrain-my_eval:58.6227\ttest-my_eval:147.225\n",
      "[514]\ttrain-rmse:201.363\ttest-rmse:129.187\ttrain-my_eval:58.6191\ttest-my_eval:147.193\n",
      "[515]\ttrain-rmse:201.362\ttest-rmse:129.186\ttrain-my_eval:58.6157\ttest-my_eval:147.184\n",
      "[516]\ttrain-rmse:201.361\ttest-rmse:129.185\ttrain-my_eval:58.6134\ttest-my_eval:147.171\n",
      "[517]\ttrain-rmse:201.361\ttest-rmse:129.184\ttrain-my_eval:58.6135\ttest-my_eval:147.194\n",
      "[518]\ttrain-rmse:201.36\ttest-rmse:129.184\ttrain-my_eval:58.6064\ttest-my_eval:147.181\n",
      "[519]\ttrain-rmse:201.359\ttest-rmse:129.183\ttrain-my_eval:58.5894\ttest-my_eval:147.128\n",
      "[520]\ttrain-rmse:201.359\ttest-rmse:129.183\ttrain-my_eval:58.5768\ttest-my_eval:147.134\n",
      "[521]\ttrain-rmse:201.358\ttest-rmse:129.183\ttrain-my_eval:58.5722\ttest-my_eval:147.111\n",
      "[522]\ttrain-rmse:201.357\ttest-rmse:129.182\ttrain-my_eval:58.5579\ttest-my_eval:147.144\n",
      "[523]\ttrain-rmse:201.357\ttest-rmse:129.181\ttrain-my_eval:58.5514\ttest-my_eval:147.137\n",
      "[524]\ttrain-rmse:201.356\ttest-rmse:129.18\ttrain-my_eval:58.5482\ttest-my_eval:147.127\n",
      "[525]\ttrain-rmse:201.355\ttest-rmse:129.179\ttrain-my_eval:58.5538\ttest-my_eval:147.194\n",
      "[526]\ttrain-rmse:201.354\ttest-rmse:129.178\ttrain-my_eval:58.5437\ttest-my_eval:147.192\n",
      "[527]\ttrain-rmse:201.354\ttest-rmse:129.178\ttrain-my_eval:58.541\ttest-my_eval:147.191\n",
      "[528]\ttrain-rmse:201.353\ttest-rmse:129.177\ttrain-my_eval:58.5359\ttest-my_eval:147.195\n",
      "[529]\ttrain-rmse:201.352\ttest-rmse:129.176\ttrain-my_eval:58.5378\ttest-my_eval:147.235\n",
      "[530]\ttrain-rmse:201.352\ttest-rmse:129.175\ttrain-my_eval:58.5214\ttest-my_eval:147.354\n",
      "[531]\ttrain-rmse:201.351\ttest-rmse:129.174\ttrain-my_eval:58.5206\ttest-my_eval:147.372\n",
      "[532]\ttrain-rmse:201.35\ttest-rmse:129.174\ttrain-my_eval:58.5139\ttest-my_eval:147.39\n",
      "[533]\ttrain-rmse:201.35\ttest-rmse:129.173\ttrain-my_eval:58.5081\ttest-my_eval:147.403\n",
      "[534]\ttrain-rmse:201.349\ttest-rmse:129.173\ttrain-my_eval:58.4762\ttest-my_eval:147.366\n",
      "[535]\ttrain-rmse:201.349\ttest-rmse:129.172\ttrain-my_eval:58.4674\ttest-my_eval:147.312\n",
      "[536]\ttrain-rmse:201.348\ttest-rmse:129.171\ttrain-my_eval:58.4606\ttest-my_eval:147.321\n",
      "[537]\ttrain-rmse:201.348\ttest-rmse:129.171\ttrain-my_eval:58.4509\ttest-my_eval:147.321\n",
      "[538]\ttrain-rmse:201.347\ttest-rmse:129.17\ttrain-my_eval:58.453\ttest-my_eval:147.35\n",
      "[539]\ttrain-rmse:201.347\ttest-rmse:129.169\ttrain-my_eval:58.4565\ttest-my_eval:147.36\n",
      "[540]\ttrain-rmse:201.346\ttest-rmse:129.169\ttrain-my_eval:58.4559\ttest-my_eval:147.576\n",
      "[541]\ttrain-rmse:201.346\ttest-rmse:129.168\ttrain-my_eval:58.4401\ttest-my_eval:147.538\n",
      "[542]\ttrain-rmse:201.345\ttest-rmse:129.167\ttrain-my_eval:58.4465\ttest-my_eval:147.575\n",
      "[543]\ttrain-rmse:201.344\ttest-rmse:129.166\ttrain-my_eval:58.4386\ttest-my_eval:147.528\n",
      "[544]\ttrain-rmse:201.344\ttest-rmse:129.165\ttrain-my_eval:58.4533\ttest-my_eval:147.629\n",
      "[545]\ttrain-rmse:201.343\ttest-rmse:129.165\ttrain-my_eval:58.4349\ttest-my_eval:147.605\n",
      "[546]\ttrain-rmse:201.342\ttest-rmse:129.164\ttrain-my_eval:58.433\ttest-my_eval:147.622\n",
      "[547]\ttrain-rmse:201.342\ttest-rmse:129.164\ttrain-my_eval:58.4229\ttest-my_eval:147.598\n",
      "[548]\ttrain-rmse:201.341\ttest-rmse:129.163\ttrain-my_eval:58.4196\ttest-my_eval:147.624\n",
      "[549]\ttrain-rmse:201.341\ttest-rmse:129.162\ttrain-my_eval:58.417\ttest-my_eval:147.627\n",
      "[550]\ttrain-rmse:201.34\ttest-rmse:129.161\ttrain-my_eval:58.4234\ttest-my_eval:147.69\n",
      "[551]\ttrain-rmse:201.34\ttest-rmse:129.161\ttrain-my_eval:58.4101\ttest-my_eval:147.663\n",
      "[552]\ttrain-rmse:201.339\ttest-rmse:129.16\ttrain-my_eval:58.3992\ttest-my_eval:147.679\n",
      "[553]\ttrain-rmse:201.339\ttest-rmse:129.159\ttrain-my_eval:58.38\ttest-my_eval:147.67\n",
      "[554]\ttrain-rmse:201.338\ttest-rmse:129.159\ttrain-my_eval:58.3735\ttest-my_eval:147.693\n",
      "[555]\ttrain-rmse:201.337\ttest-rmse:129.158\ttrain-my_eval:58.358\ttest-my_eval:147.737\n",
      "[556]\ttrain-rmse:201.337\ttest-rmse:129.157\ttrain-my_eval:58.365\ttest-my_eval:147.772\n",
      "[557]\ttrain-rmse:201.336\ttest-rmse:129.157\ttrain-my_eval:58.356\ttest-my_eval:147.793\n",
      "[558]\ttrain-rmse:201.336\ttest-rmse:129.156\ttrain-my_eval:58.3558\ttest-my_eval:147.796\n",
      "[559]\ttrain-rmse:201.335\ttest-rmse:129.156\ttrain-my_eval:58.3564\ttest-my_eval:147.788\n",
      "[560]\ttrain-rmse:201.335\ttest-rmse:129.155\ttrain-my_eval:58.3418\ttest-my_eval:147.739\n",
      "[561]\ttrain-rmse:201.334\ttest-rmse:129.155\ttrain-my_eval:58.3426\ttest-my_eval:147.787\n",
      "[562]\ttrain-rmse:201.334\ttest-rmse:129.154\ttrain-my_eval:58.3412\ttest-my_eval:147.791\n",
      "[563]\ttrain-rmse:201.333\ttest-rmse:129.153\ttrain-my_eval:58.3268\ttest-my_eval:147.818\n",
      "[564]\ttrain-rmse:201.332\ttest-rmse:129.152\ttrain-my_eval:58.3148\ttest-my_eval:147.809\n",
      "[565]\ttrain-rmse:201.332\ttest-rmse:129.152\ttrain-my_eval:58.3211\ttest-my_eval:147.858\n",
      "[566]\ttrain-rmse:201.331\ttest-rmse:129.151\ttrain-my_eval:58.3109\ttest-my_eval:147.868\n",
      "[567]\ttrain-rmse:201.331\ttest-rmse:129.151\ttrain-my_eval:58.3129\ttest-my_eval:147.864\n",
      "[568]\ttrain-rmse:201.33\ttest-rmse:129.15\ttrain-my_eval:58.3111\ttest-my_eval:147.83\n",
      "[569]\ttrain-rmse:201.33\ttest-rmse:129.15\ttrain-my_eval:58.2984\ttest-my_eval:147.835\n",
      "[570]\ttrain-rmse:201.33\ttest-rmse:129.149\ttrain-my_eval:58.2919\ttest-my_eval:147.759\n",
      "[571]\ttrain-rmse:201.329\ttest-rmse:129.149\ttrain-my_eval:58.2911\ttest-my_eval:147.752\n",
      "[572]\ttrain-rmse:201.329\ttest-rmse:129.148\ttrain-my_eval:58.2985\ttest-my_eval:147.821\n",
      "[573]\ttrain-rmse:201.328\ttest-rmse:129.147\ttrain-my_eval:58.3029\ttest-my_eval:147.91\n",
      "[574]\ttrain-rmse:201.327\ttest-rmse:129.146\ttrain-my_eval:58.3074\ttest-my_eval:147.935\n",
      "[575]\ttrain-rmse:201.327\ttest-rmse:129.145\ttrain-my_eval:58.2893\ttest-my_eval:148.035\n",
      "[576]\ttrain-rmse:201.326\ttest-rmse:129.145\ttrain-my_eval:58.288\ttest-my_eval:148.018\n",
      "[577]\ttrain-rmse:201.326\ttest-rmse:129.145\ttrain-my_eval:58.2808\ttest-my_eval:148.031\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[578]\ttrain-rmse:201.325\ttest-rmse:129.144\ttrain-my_eval:58.2859\ttest-my_eval:148.097\n",
      "[579]\ttrain-rmse:201.325\ttest-rmse:129.144\ttrain-my_eval:58.2734\ttest-my_eval:148.082\n",
      "[580]\ttrain-rmse:201.325\ttest-rmse:129.143\ttrain-my_eval:58.2563\ttest-my_eval:148.051\n",
      "[581]\ttrain-rmse:201.324\ttest-rmse:129.143\ttrain-my_eval:58.2351\ttest-my_eval:148.064\n",
      "[582]\ttrain-rmse:201.323\ttest-rmse:129.142\ttrain-my_eval:58.2198\ttest-my_eval:147.992\n",
      "[583]\ttrain-rmse:201.322\ttest-rmse:129.141\ttrain-my_eval:58.2059\ttest-my_eval:147.992\n",
      "[584]\ttrain-rmse:201.322\ttest-rmse:129.14\ttrain-my_eval:58.2033\ttest-my_eval:147.996\n",
      "[585]\ttrain-rmse:201.321\ttest-rmse:129.139\ttrain-my_eval:58.2004\ttest-my_eval:147.998\n",
      "[586]\ttrain-rmse:201.32\ttest-rmse:129.139\ttrain-my_eval:58.1821\ttest-my_eval:147.997\n",
      "[587]\ttrain-rmse:201.32\ttest-rmse:129.139\ttrain-my_eval:58.176\ttest-my_eval:147.964\n",
      "[588]\ttrain-rmse:201.319\ttest-rmse:129.138\ttrain-my_eval:58.1855\ttest-my_eval:148.053\n",
      "[589]\ttrain-rmse:201.319\ttest-rmse:129.137\ttrain-my_eval:58.1837\ttest-my_eval:148.097\n",
      "[590]\ttrain-rmse:201.318\ttest-rmse:129.136\ttrain-my_eval:58.1704\ttest-my_eval:148.094\n",
      "[591]\ttrain-rmse:201.317\ttest-rmse:129.136\ttrain-my_eval:58.1756\ttest-my_eval:148.103\n",
      "[592]\ttrain-rmse:201.317\ttest-rmse:129.135\ttrain-my_eval:58.1598\ttest-my_eval:148.093\n",
      "[593]\ttrain-rmse:201.316\ttest-rmse:129.134\ttrain-my_eval:58.1669\ttest-my_eval:148.121\n",
      "[594]\ttrain-rmse:201.316\ttest-rmse:129.134\ttrain-my_eval:58.1709\ttest-my_eval:148.16\n",
      "[595]\ttrain-rmse:201.315\ttest-rmse:129.133\ttrain-my_eval:58.1726\ttest-my_eval:148.194\n",
      "[596]\ttrain-rmse:201.315\ttest-rmse:129.133\ttrain-my_eval:58.1636\ttest-my_eval:148.203\n",
      "[597]\ttrain-rmse:201.314\ttest-rmse:129.132\ttrain-my_eval:58.1483\ttest-my_eval:148.193\n",
      "[598]\ttrain-rmse:201.314\ttest-rmse:129.131\ttrain-my_eval:58.1409\ttest-my_eval:148.176\n",
      "[599]\ttrain-rmse:201.313\ttest-rmse:129.131\ttrain-my_eval:58.1392\ttest-my_eval:148.172\n",
      "[600]\ttrain-rmse:201.312\ttest-rmse:129.13\ttrain-my_eval:58.1286\ttest-my_eval:148.174\n",
      "[601]\ttrain-rmse:201.312\ttest-rmse:129.129\ttrain-my_eval:58.1265\ttest-my_eval:148.231\n",
      "[602]\ttrain-rmse:201.311\ttest-rmse:129.129\ttrain-my_eval:58.111\ttest-my_eval:148.205\n",
      "[603]\ttrain-rmse:201.31\ttest-rmse:129.128\ttrain-my_eval:58.1085\ttest-my_eval:148.214\n",
      "[604]\ttrain-rmse:201.31\ttest-rmse:129.127\ttrain-my_eval:58.1026\ttest-my_eval:148.166\n",
      "[605]\ttrain-rmse:201.309\ttest-rmse:129.126\ttrain-my_eval:58.0868\ttest-my_eval:148.147\n",
      "[606]\ttrain-rmse:201.308\ttest-rmse:129.126\ttrain-my_eval:58.0905\ttest-my_eval:148.141\n",
      "[607]\ttrain-rmse:201.308\ttest-rmse:129.125\ttrain-my_eval:58.0922\ttest-my_eval:148.103\n",
      "[608]\ttrain-rmse:201.307\ttest-rmse:129.124\ttrain-my_eval:58.0741\ttest-my_eval:148.105\n",
      "[609]\ttrain-rmse:201.307\ttest-rmse:129.124\ttrain-my_eval:58.0689\ttest-my_eval:148.136\n",
      "[610]\ttrain-rmse:201.306\ttest-rmse:129.123\ttrain-my_eval:58.0781\ttest-my_eval:148.17\n",
      "[611]\ttrain-rmse:201.305\ttest-rmse:129.122\ttrain-my_eval:58.0668\ttest-my_eval:148.136\n",
      "[612]\ttrain-rmse:201.305\ttest-rmse:129.121\ttrain-my_eval:58.0773\ttest-my_eval:148.202\n",
      "[613]\ttrain-rmse:201.304\ttest-rmse:129.121\ttrain-my_eval:58.0649\ttest-my_eval:148.339\n",
      "[614]\ttrain-rmse:201.304\ttest-rmse:129.12\ttrain-my_eval:58.0706\ttest-my_eval:148.375\n",
      "[615]\ttrain-rmse:201.303\ttest-rmse:129.119\ttrain-my_eval:58.0598\ttest-my_eval:148.368\n",
      "[616]\ttrain-rmse:201.303\ttest-rmse:129.119\ttrain-my_eval:58.062\ttest-my_eval:148.325\n",
      "[617]\ttrain-rmse:201.302\ttest-rmse:129.118\ttrain-my_eval:58.0348\ttest-my_eval:148.272\n",
      "[618]\ttrain-rmse:201.302\ttest-rmse:129.117\ttrain-my_eval:58.0412\ttest-my_eval:148.314\n",
      "[619]\ttrain-rmse:201.301\ttest-rmse:129.116\ttrain-my_eval:58.0453\ttest-my_eval:148.309\n",
      "[620]\ttrain-rmse:201.3\ttest-rmse:129.116\ttrain-my_eval:58.0411\ttest-my_eval:148.354\n",
      "[621]\ttrain-rmse:201.3\ttest-rmse:129.115\ttrain-my_eval:58.038\ttest-my_eval:148.362\n",
      "[622]\ttrain-rmse:201.3\ttest-rmse:129.115\ttrain-my_eval:58.0287\ttest-my_eval:148.353\n",
      "[623]\ttrain-rmse:201.299\ttest-rmse:129.114\ttrain-my_eval:58.0149\ttest-my_eval:148.452\n",
      "[624]\ttrain-rmse:201.299\ttest-rmse:129.114\ttrain-my_eval:58.007\ttest-my_eval:148.467\n",
      "[625]\ttrain-rmse:201.298\ttest-rmse:129.114\ttrain-my_eval:58.0101\ttest-my_eval:148.459\n",
      "[626]\ttrain-rmse:201.297\ttest-rmse:129.113\ttrain-my_eval:58.0064\ttest-my_eval:148.464\n",
      "[627]\ttrain-rmse:201.297\ttest-rmse:129.113\ttrain-my_eval:57.9941\ttest-my_eval:148.45\n",
      "[628]\ttrain-rmse:201.297\ttest-rmse:129.113\ttrain-my_eval:57.9881\ttest-my_eval:148.489\n",
      "[629]\ttrain-rmse:201.297\ttest-rmse:129.112\ttrain-my_eval:57.9762\ttest-my_eval:148.486\n",
      "[630]\ttrain-rmse:201.296\ttest-rmse:129.112\ttrain-my_eval:57.9722\ttest-my_eval:148.503\n",
      "[631]\ttrain-rmse:201.296\ttest-rmse:129.112\ttrain-my_eval:57.9655\ttest-my_eval:148.503\n",
      "[632]\ttrain-rmse:201.295\ttest-rmse:129.111\ttrain-my_eval:57.965\ttest-my_eval:148.51\n",
      "[633]\ttrain-rmse:201.294\ttest-rmse:129.11\ttrain-my_eval:57.9736\ttest-my_eval:148.588\n",
      "[634]\ttrain-rmse:201.294\ttest-rmse:129.11\ttrain-my_eval:57.9704\ttest-my_eval:148.608\n",
      "[635]\ttrain-rmse:201.294\ttest-rmse:129.11\ttrain-my_eval:57.9634\ttest-my_eval:148.594\n",
      "[636]\ttrain-rmse:201.293\ttest-rmse:129.109\ttrain-my_eval:57.9596\ttest-my_eval:148.558\n",
      "[637]\ttrain-rmse:201.293\ttest-rmse:129.109\ttrain-my_eval:57.9492\ttest-my_eval:148.595\n",
      "[638]\ttrain-rmse:201.292\ttest-rmse:129.109\ttrain-my_eval:57.9495\ttest-my_eval:148.579\n",
      "[639]\ttrain-rmse:201.292\ttest-rmse:129.108\ttrain-my_eval:57.9292\ttest-my_eval:148.548\n",
      "[640]\ttrain-rmse:201.291\ttest-rmse:129.108\ttrain-my_eval:57.9258\ttest-my_eval:148.541\n",
      "[641]\ttrain-rmse:201.291\ttest-rmse:129.107\ttrain-my_eval:57.919\ttest-my_eval:148.561\n",
      "[642]\ttrain-rmse:201.29\ttest-rmse:129.106\ttrain-my_eval:57.9201\ttest-my_eval:148.563\n",
      "[643]\ttrain-rmse:201.29\ttest-rmse:129.105\ttrain-my_eval:57.9177\ttest-my_eval:148.552\n",
      "[644]\ttrain-rmse:201.289\ttest-rmse:129.105\ttrain-my_eval:57.9024\ttest-my_eval:148.559\n",
      "[645]\ttrain-rmse:201.288\ttest-rmse:129.104\ttrain-my_eval:57.9052\ttest-my_eval:148.574\n",
      "[646]\ttrain-rmse:201.288\ttest-rmse:129.103\ttrain-my_eval:57.9133\ttest-my_eval:148.621\n",
      "[647]\ttrain-rmse:201.287\ttest-rmse:129.102\ttrain-my_eval:57.9047\ttest-my_eval:148.554\n",
      "[648]\ttrain-rmse:201.287\ttest-rmse:129.102\ttrain-my_eval:57.9043\ttest-my_eval:148.557\n",
      "[649]\ttrain-rmse:201.286\ttest-rmse:129.101\ttrain-my_eval:57.8888\ttest-my_eval:148.519\n",
      "[650]\ttrain-rmse:201.286\ttest-rmse:129.1\ttrain-my_eval:57.8856\ttest-my_eval:148.51\n",
      "[651]\ttrain-rmse:201.285\ttest-rmse:129.1\ttrain-my_eval:57.8864\ttest-my_eval:148.522\n",
      "[652]\ttrain-rmse:201.285\ttest-rmse:129.099\ttrain-my_eval:57.8699\ttest-my_eval:148.505\n",
      "[653]\ttrain-rmse:201.284\ttest-rmse:129.099\ttrain-my_eval:57.8632\ttest-my_eval:148.51\n",
      "[654]\ttrain-rmse:201.283\ttest-rmse:129.099\ttrain-my_eval:57.8681\ttest-my_eval:148.546\n",
      "[655]\ttrain-rmse:201.283\ttest-rmse:129.098\ttrain-my_eval:57.8565\ttest-my_eval:148.509\n",
      "[656]\ttrain-rmse:201.283\ttest-rmse:129.098\ttrain-my_eval:57.8496\ttest-my_eval:148.495\n",
      "[657]\ttrain-rmse:201.282\ttest-rmse:129.097\ttrain-my_eval:57.8535\ttest-my_eval:148.503\n",
      "[658]\ttrain-rmse:201.282\ttest-rmse:129.097\ttrain-my_eval:57.8364\ttest-my_eval:148.46\n",
      "[659]\ttrain-rmse:201.281\ttest-rmse:129.096\ttrain-my_eval:57.825\ttest-my_eval:148.401\n",
      "[660]\ttrain-rmse:201.281\ttest-rmse:129.095\ttrain-my_eval:57.8283\ttest-my_eval:148.391\n",
      "[661]\ttrain-rmse:201.28\ttest-rmse:129.095\ttrain-my_eval:57.8274\ttest-my_eval:148.381\n",
      "[662]\ttrain-rmse:201.28\ttest-rmse:129.094\ttrain-my_eval:57.8087\ttest-my_eval:148.38\n",
      "[663]\ttrain-rmse:201.279\ttest-rmse:129.094\ttrain-my_eval:57.7982\ttest-my_eval:148.369\n",
      "[664]\ttrain-rmse:201.279\ttest-rmse:129.093\ttrain-my_eval:57.7902\ttest-my_eval:148.38\n",
      "[665]\ttrain-rmse:201.279\ttest-rmse:129.093\ttrain-my_eval:57.797\ttest-my_eval:148.387\n",
      "[666]\ttrain-rmse:201.278\ttest-rmse:129.092\ttrain-my_eval:57.789\ttest-my_eval:148.388\n",
      "[667]\ttrain-rmse:201.277\ttest-rmse:129.091\ttrain-my_eval:57.7919\ttest-my_eval:148.457\n",
      "[668]\ttrain-rmse:201.277\ttest-rmse:129.091\ttrain-my_eval:57.7941\ttest-my_eval:148.46\n",
      "[669]\ttrain-rmse:201.276\ttest-rmse:129.09\ttrain-my_eval:57.7955\ttest-my_eval:148.453\n",
      "[670]\ttrain-rmse:201.276\ttest-rmse:129.09\ttrain-my_eval:57.7956\ttest-my_eval:148.457\n",
      "[671]\ttrain-rmse:201.275\ttest-rmse:129.089\ttrain-my_eval:57.7974\ttest-my_eval:148.499\n",
      "[672]\ttrain-rmse:201.275\ttest-rmse:129.089\ttrain-my_eval:57.7954\ttest-my_eval:148.492\n",
      "[673]\ttrain-rmse:201.275\ttest-rmse:129.088\ttrain-my_eval:57.7954\ttest-my_eval:148.486\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[674]\ttrain-rmse:201.274\ttest-rmse:129.088\ttrain-my_eval:57.7846\ttest-my_eval:148.483\n",
      "[675]\ttrain-rmse:201.274\ttest-rmse:129.087\ttrain-my_eval:57.7749\ttest-my_eval:148.499\n",
      "[676]\ttrain-rmse:201.273\ttest-rmse:129.087\ttrain-my_eval:57.7776\ttest-my_eval:148.563\n",
      "[677]\ttrain-rmse:201.273\ttest-rmse:129.086\ttrain-my_eval:57.7761\ttest-my_eval:148.57\n",
      "[678]\ttrain-rmse:201.272\ttest-rmse:129.086\ttrain-my_eval:57.7746\ttest-my_eval:148.536\n",
      "[679]\ttrain-rmse:201.272\ttest-rmse:129.085\ttrain-my_eval:57.7677\ttest-my_eval:148.746\n",
      "[680]\ttrain-rmse:201.271\ttest-rmse:129.084\ttrain-my_eval:57.7672\ttest-my_eval:148.813\n",
      "[681]\ttrain-rmse:201.271\ttest-rmse:129.084\ttrain-my_eval:57.7588\ttest-my_eval:148.8\n",
      "[682]\ttrain-rmse:201.27\ttest-rmse:129.083\ttrain-my_eval:57.7521\ttest-my_eval:148.794\n",
      "[683]\ttrain-rmse:201.27\ttest-rmse:129.083\ttrain-my_eval:57.7512\ttest-my_eval:148.795\n",
      "[684]\ttrain-rmse:201.269\ttest-rmse:129.082\ttrain-my_eval:57.7434\ttest-my_eval:148.807\n",
      "[685]\ttrain-rmse:201.269\ttest-rmse:129.081\ttrain-my_eval:57.7357\ttest-my_eval:148.8\n",
      "[686]\ttrain-rmse:201.268\ttest-rmse:129.081\ttrain-my_eval:57.725\ttest-my_eval:148.755\n",
      "[687]\ttrain-rmse:201.267\ttest-rmse:129.08\ttrain-my_eval:57.7225\ttest-my_eval:148.765\n",
      "[688]\ttrain-rmse:201.267\ttest-rmse:129.08\ttrain-my_eval:57.7273\ttest-my_eval:148.783\n",
      "[689]\ttrain-rmse:201.267\ttest-rmse:129.079\ttrain-my_eval:57.7217\ttest-my_eval:148.794\n",
      "[690]\ttrain-rmse:201.266\ttest-rmse:129.079\ttrain-my_eval:57.7155\ttest-my_eval:148.832\n",
      "[691]\ttrain-rmse:201.266\ttest-rmse:129.078\ttrain-my_eval:57.7122\ttest-my_eval:148.894\n",
      "[692]\ttrain-rmse:201.266\ttest-rmse:129.078\ttrain-my_eval:57.6952\ttest-my_eval:148.889\n",
      "[693]\ttrain-rmse:201.265\ttest-rmse:129.078\ttrain-my_eval:57.7039\ttest-my_eval:148.929\n",
      "[694]\ttrain-rmse:201.265\ttest-rmse:129.077\ttrain-my_eval:57.7084\ttest-my_eval:148.911\n",
      "[695]\ttrain-rmse:201.264\ttest-rmse:129.076\ttrain-my_eval:57.7073\ttest-my_eval:148.864\n",
      "[696]\ttrain-rmse:201.264\ttest-rmse:129.075\ttrain-my_eval:57.7019\ttest-my_eval:148.846\n",
      "[697]\ttrain-rmse:201.263\ttest-rmse:129.075\ttrain-my_eval:57.7075\ttest-my_eval:148.864\n",
      "[698]\ttrain-rmse:201.262\ttest-rmse:129.074\ttrain-my_eval:57.7003\ttest-my_eval:148.872\n",
      "[699]\ttrain-rmse:201.262\ttest-rmse:129.074\ttrain-my_eval:57.68\ttest-my_eval:148.832\n",
      "[700]\ttrain-rmse:201.262\ttest-rmse:129.074\ttrain-my_eval:57.6662\ttest-my_eval:148.823\n",
      "[701]\ttrain-rmse:201.262\ttest-rmse:129.073\ttrain-my_eval:57.66\ttest-my_eval:148.836\n",
      "[702]\ttrain-rmse:201.261\ttest-rmse:129.073\ttrain-my_eval:57.6505\ttest-my_eval:148.834\n",
      "[703]\ttrain-rmse:201.261\ttest-rmse:129.072\ttrain-my_eval:57.6449\ttest-my_eval:148.823\n",
      "[704]\ttrain-rmse:201.26\ttest-rmse:129.071\ttrain-my_eval:57.6362\ttest-my_eval:148.771\n",
      "[705]\ttrain-rmse:201.26\ttest-rmse:129.071\ttrain-my_eval:57.6316\ttest-my_eval:148.773\n",
      "[706]\ttrain-rmse:201.259\ttest-rmse:129.07\ttrain-my_eval:57.6363\ttest-my_eval:148.816\n",
      "[707]\ttrain-rmse:201.259\ttest-rmse:129.07\ttrain-my_eval:57.6497\ttest-my_eval:148.889\n",
      "[708]\ttrain-rmse:201.258\ttest-rmse:129.069\ttrain-my_eval:57.6501\ttest-my_eval:148.897\n",
      "[709]\ttrain-rmse:201.258\ttest-rmse:129.069\ttrain-my_eval:57.6382\ttest-my_eval:148.885\n",
      "[710]\ttrain-rmse:201.257\ttest-rmse:129.068\ttrain-my_eval:57.6328\ttest-my_eval:148.88\n",
      "[711]\ttrain-rmse:201.257\ttest-rmse:129.067\ttrain-my_eval:57.6295\ttest-my_eval:148.873\n",
      "[712]\ttrain-rmse:201.256\ttest-rmse:129.067\ttrain-my_eval:57.6284\ttest-my_eval:148.958\n",
      "[713]\ttrain-rmse:201.256\ttest-rmse:129.067\ttrain-my_eval:57.6215\ttest-my_eval:148.96\n",
      "[714]\ttrain-rmse:201.255\ttest-rmse:129.066\ttrain-my_eval:57.6223\ttest-my_eval:149.023\n",
      "[715]\ttrain-rmse:201.255\ttest-rmse:129.066\ttrain-my_eval:57.6174\ttest-my_eval:149.071\n",
      "[716]\ttrain-rmse:201.255\ttest-rmse:129.066\ttrain-my_eval:57.6108\ttest-my_eval:149.035\n",
      "[717]\ttrain-rmse:201.255\ttest-rmse:129.065\ttrain-my_eval:57.6148\ttest-my_eval:149.052\n",
      "[718]\ttrain-rmse:201.254\ttest-rmse:129.064\ttrain-my_eval:57.5991\ttest-my_eval:149.045\n",
      "[719]\ttrain-rmse:201.254\ttest-rmse:129.064\ttrain-my_eval:57.592\ttest-my_eval:149.026\n",
      "[720]\ttrain-rmse:201.254\ttest-rmse:129.063\ttrain-my_eval:57.5911\ttest-my_eval:149.028\n",
      "[721]\ttrain-rmse:201.253\ttest-rmse:129.063\ttrain-my_eval:57.583\ttest-my_eval:149.033\n",
      "[722]\ttrain-rmse:201.253\ttest-rmse:129.063\ttrain-my_eval:57.5848\ttest-my_eval:149.028\n",
      "[723]\ttrain-rmse:201.252\ttest-rmse:129.062\ttrain-my_eval:57.5732\ttest-my_eval:149.013\n",
      "[724]\ttrain-rmse:201.252\ttest-rmse:129.062\ttrain-my_eval:57.579\ttest-my_eval:149.022\n",
      "[725]\ttrain-rmse:201.251\ttest-rmse:129.061\ttrain-my_eval:57.5666\ttest-my_eval:149.001\n",
      "[726]\ttrain-rmse:201.251\ttest-rmse:129.061\ttrain-my_eval:57.5655\ttest-my_eval:148.994\n",
      "[727]\ttrain-rmse:201.25\ttest-rmse:129.061\ttrain-my_eval:57.5761\ttest-my_eval:149.038\n",
      "[728]\ttrain-rmse:201.25\ttest-rmse:129.06\ttrain-my_eval:57.5843\ttest-my_eval:149.061\n",
      "[729]\ttrain-rmse:201.249\ttest-rmse:129.059\ttrain-my_eval:57.5792\ttest-my_eval:149.096\n",
      "[730]\ttrain-rmse:201.249\ttest-rmse:129.059\ttrain-my_eval:57.5677\ttest-my_eval:149.079\n",
      "[731]\ttrain-rmse:201.249\ttest-rmse:129.059\ttrain-my_eval:57.556\ttest-my_eval:149.071\n",
      "[732]\ttrain-rmse:201.248\ttest-rmse:129.058\ttrain-my_eval:57.5501\ttest-my_eval:149.041\n",
      "[733]\ttrain-rmse:201.248\ttest-rmse:129.058\ttrain-my_eval:57.5511\ttest-my_eval:149.054\n",
      "[734]\ttrain-rmse:201.247\ttest-rmse:129.057\ttrain-my_eval:57.5573\ttest-my_eval:149.107\n",
      "[735]\ttrain-rmse:201.247\ttest-rmse:129.057\ttrain-my_eval:57.5572\ttest-my_eval:149.106\n",
      "[736]\ttrain-rmse:201.247\ttest-rmse:129.057\ttrain-my_eval:57.547\ttest-my_eval:149.086\n",
      "[737]\ttrain-rmse:201.246\ttest-rmse:129.056\ttrain-my_eval:57.5411\ttest-my_eval:149.083\n",
      "[738]\ttrain-rmse:201.246\ttest-rmse:129.056\ttrain-my_eval:57.5355\ttest-my_eval:149.059\n",
      "[739]\ttrain-rmse:201.246\ttest-rmse:129.056\ttrain-my_eval:57.5192\ttest-my_eval:149.044\n",
      "[740]\ttrain-rmse:201.245\ttest-rmse:129.055\ttrain-my_eval:57.5205\ttest-my_eval:149.058\n",
      "[741]\ttrain-rmse:201.245\ttest-rmse:129.055\ttrain-my_eval:57.5231\ttest-my_eval:149.078\n",
      "[742]\ttrain-rmse:201.244\ttest-rmse:129.054\ttrain-my_eval:57.5182\ttest-my_eval:149.078\n",
      "[743]\ttrain-rmse:201.244\ttest-rmse:129.053\ttrain-my_eval:57.5243\ttest-my_eval:149.076\n",
      "[744]\ttrain-rmse:201.244\ttest-rmse:129.053\ttrain-my_eval:57.5213\ttest-my_eval:149.111\n",
      "[745]\ttrain-rmse:201.243\ttest-rmse:129.053\ttrain-my_eval:57.5119\ttest-my_eval:149.091\n",
      "[746]\ttrain-rmse:201.242\ttest-rmse:129.053\ttrain-my_eval:57.5057\ttest-my_eval:149.057\n",
      "[747]\ttrain-rmse:201.242\ttest-rmse:129.052\ttrain-my_eval:57.5019\ttest-my_eval:149.013\n",
      "[748]\ttrain-rmse:201.242\ttest-rmse:129.052\ttrain-my_eval:57.4849\ttest-my_eval:149.087\n",
      "[749]\ttrain-rmse:201.242\ttest-rmse:129.052\ttrain-my_eval:57.4708\ttest-my_eval:149.086\n",
      "[750]\ttrain-rmse:201.241\ttest-rmse:129.051\ttrain-my_eval:57.4729\ttest-my_eval:149.114\n",
      "[751]\ttrain-rmse:201.241\ttest-rmse:129.051\ttrain-my_eval:57.4573\ttest-my_eval:149.08\n",
      "[752]\ttrain-rmse:201.24\ttest-rmse:129.051\ttrain-my_eval:57.4521\ttest-my_eval:149.066\n",
      "[753]\ttrain-rmse:201.239\ttest-rmse:129.05\ttrain-my_eval:57.4666\ttest-my_eval:149.079\n",
      "[754]\ttrain-rmse:201.239\ttest-rmse:129.05\ttrain-my_eval:57.4655\ttest-my_eval:149.06\n",
      "[755]\ttrain-rmse:201.239\ttest-rmse:129.049\ttrain-my_eval:57.4729\ttest-my_eval:149.2\n",
      "[756]\ttrain-rmse:201.239\ttest-rmse:129.049\ttrain-my_eval:57.474\ttest-my_eval:149.251\n",
      "[757]\ttrain-rmse:201.238\ttest-rmse:129.049\ttrain-my_eval:57.4627\ttest-my_eval:149.212\n",
      "[758]\ttrain-rmse:201.238\ttest-rmse:129.049\ttrain-my_eval:57.4629\ttest-my_eval:149.227\n",
      "[759]\ttrain-rmse:201.238\ttest-rmse:129.048\ttrain-my_eval:57.459\ttest-my_eval:149.232\n",
      "[760]\ttrain-rmse:201.237\ttest-rmse:129.048\ttrain-my_eval:57.4506\ttest-my_eval:149.204\n",
      "[761]\ttrain-rmse:201.237\ttest-rmse:129.047\ttrain-my_eval:57.451\ttest-my_eval:149.19\n",
      "[762]\ttrain-rmse:201.236\ttest-rmse:129.046\ttrain-my_eval:57.4369\ttest-my_eval:149.171\n",
      "[763]\ttrain-rmse:201.236\ttest-rmse:129.046\ttrain-my_eval:57.426\ttest-my_eval:149.154\n",
      "[764]\ttrain-rmse:201.236\ttest-rmse:129.046\ttrain-my_eval:57.4233\ttest-my_eval:149.155\n",
      "[765]\ttrain-rmse:201.235\ttest-rmse:129.045\ttrain-my_eval:57.4208\ttest-my_eval:149.176\n",
      "[766]\ttrain-rmse:201.235\ttest-rmse:129.045\ttrain-my_eval:57.4268\ttest-my_eval:149.339\n",
      "[767]\ttrain-rmse:201.234\ttest-rmse:129.044\ttrain-my_eval:57.4293\ttest-my_eval:149.34\n",
      "[768]\ttrain-rmse:201.234\ttest-rmse:129.044\ttrain-my_eval:57.4187\ttest-my_eval:149.322\n",
      "[769]\ttrain-rmse:201.233\ttest-rmse:129.043\ttrain-my_eval:57.4091\ttest-my_eval:149.391\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[770]\ttrain-rmse:201.233\ttest-rmse:129.043\ttrain-my_eval:57.4246\ttest-my_eval:149.454\n",
      "[771]\ttrain-rmse:201.232\ttest-rmse:129.042\ttrain-my_eval:57.4239\ttest-my_eval:149.436\n",
      "[772]\ttrain-rmse:201.232\ttest-rmse:129.042\ttrain-my_eval:57.428\ttest-my_eval:149.453\n",
      "[773]\ttrain-rmse:201.232\ttest-rmse:129.041\ttrain-my_eval:57.4091\ttest-my_eval:149.412\n",
      "[774]\ttrain-rmse:201.231\ttest-rmse:129.041\ttrain-my_eval:57.4023\ttest-my_eval:149.415\n",
      "[775]\ttrain-rmse:201.231\ttest-rmse:129.04\ttrain-my_eval:57.4083\ttest-my_eval:149.478\n",
      "[776]\ttrain-rmse:201.23\ttest-rmse:129.04\ttrain-my_eval:57.4045\ttest-my_eval:149.484\n",
      "[777]\ttrain-rmse:201.23\ttest-rmse:129.039\ttrain-my_eval:57.4047\ttest-my_eval:149.521\n",
      "[778]\ttrain-rmse:201.229\ttest-rmse:129.039\ttrain-my_eval:57.4068\ttest-my_eval:149.527\n",
      "[779]\ttrain-rmse:201.229\ttest-rmse:129.038\ttrain-my_eval:57.4089\ttest-my_eval:149.545\n",
      "[780]\ttrain-rmse:201.229\ttest-rmse:129.038\ttrain-my_eval:57.4026\ttest-my_eval:149.559\n",
      "[781]\ttrain-rmse:201.229\ttest-rmse:129.038\ttrain-my_eval:57.4013\ttest-my_eval:149.559\n",
      "[782]\ttrain-rmse:201.229\ttest-rmse:129.038\ttrain-my_eval:57.3962\ttest-my_eval:149.57\n",
      "[783]\ttrain-rmse:201.228\ttest-rmse:129.037\ttrain-my_eval:57.3926\ttest-my_eval:149.537\n",
      "[784]\ttrain-rmse:201.228\ttest-rmse:129.037\ttrain-my_eval:57.3887\ttest-my_eval:149.529\n",
      "[785]\ttrain-rmse:201.227\ttest-rmse:129.036\ttrain-my_eval:57.3855\ttest-my_eval:149.502\n",
      "[786]\ttrain-rmse:201.227\ttest-rmse:129.036\ttrain-my_eval:57.3834\ttest-my_eval:149.467\n",
      "[787]\ttrain-rmse:201.226\ttest-rmse:129.035\ttrain-my_eval:57.3786\ttest-my_eval:149.473\n",
      "[788]\ttrain-rmse:201.226\ttest-rmse:129.035\ttrain-my_eval:57.3747\ttest-my_eval:149.476\n",
      "[789]\ttrain-rmse:201.225\ttest-rmse:129.034\ttrain-my_eval:57.3741\ttest-my_eval:149.519\n",
      "[790]\ttrain-rmse:201.225\ttest-rmse:129.034\ttrain-my_eval:57.3734\ttest-my_eval:149.528\n",
      "[791]\ttrain-rmse:201.225\ttest-rmse:129.033\ttrain-my_eval:57.3615\ttest-my_eval:149.507\n",
      "[792]\ttrain-rmse:201.224\ttest-rmse:129.033\ttrain-my_eval:57.3647\ttest-my_eval:149.514\n",
      "[793]\ttrain-rmse:201.224\ttest-rmse:129.033\ttrain-my_eval:57.364\ttest-my_eval:149.663\n",
      "[794]\ttrain-rmse:201.223\ttest-rmse:129.032\ttrain-my_eval:57.3567\ttest-my_eval:149.638\n",
      "[795]\ttrain-rmse:201.223\ttest-rmse:129.031\ttrain-my_eval:57.3604\ttest-my_eval:149.656\n",
      "[796]\ttrain-rmse:201.222\ttest-rmse:129.031\ttrain-my_eval:57.3626\ttest-my_eval:149.669\n",
      "[797]\ttrain-rmse:201.222\ttest-rmse:129.03\ttrain-my_eval:57.3647\ttest-my_eval:149.692\n",
      "[798]\ttrain-rmse:201.221\ttest-rmse:129.03\ttrain-my_eval:57.3572\ttest-my_eval:149.671\n",
      "[799]\ttrain-rmse:201.221\ttest-rmse:129.029\ttrain-my_eval:57.3585\ttest-my_eval:149.676\n",
      "[800]\ttrain-rmse:201.22\ttest-rmse:129.028\ttrain-my_eval:57.3504\ttest-my_eval:149.668\n",
      "[801]\ttrain-rmse:201.22\ttest-rmse:129.028\ttrain-my_eval:57.3393\ttest-my_eval:149.663\n",
      "[802]\ttrain-rmse:201.22\ttest-rmse:129.028\ttrain-my_eval:57.3391\ttest-my_eval:149.695\n",
      "[803]\ttrain-rmse:201.219\ttest-rmse:129.027\ttrain-my_eval:57.3266\ttest-my_eval:149.839\n",
      "[804]\ttrain-rmse:201.219\ttest-rmse:129.027\ttrain-my_eval:57.334\ttest-my_eval:149.842\n",
      "[805]\ttrain-rmse:201.219\ttest-rmse:129.026\ttrain-my_eval:57.3273\ttest-my_eval:149.821\n",
      "[806]\ttrain-rmse:201.218\ttest-rmse:129.026\ttrain-my_eval:57.321\ttest-my_eval:149.829\n",
      "[807]\ttrain-rmse:201.218\ttest-rmse:129.025\ttrain-my_eval:57.3119\ttest-my_eval:149.737\n",
      "[808]\ttrain-rmse:201.217\ttest-rmse:129.025\ttrain-my_eval:57.3117\ttest-my_eval:149.759\n",
      "[809]\ttrain-rmse:201.216\ttest-rmse:129.024\ttrain-my_eval:57.2981\ttest-my_eval:149.743\n",
      "[810]\ttrain-rmse:201.216\ttest-rmse:129.024\ttrain-my_eval:57.2993\ttest-my_eval:149.779\n",
      "[811]\ttrain-rmse:201.216\ttest-rmse:129.024\ttrain-my_eval:57.3005\ttest-my_eval:149.782\n",
      "[812]\ttrain-rmse:201.216\ttest-rmse:129.023\ttrain-my_eval:57.2804\ttest-my_eval:149.738\n",
      "[813]\ttrain-rmse:201.215\ttest-rmse:129.023\ttrain-my_eval:57.2857\ttest-my_eval:149.689\n",
      "[814]\ttrain-rmse:201.215\ttest-rmse:129.022\ttrain-my_eval:57.2841\ttest-my_eval:149.658\n",
      "[815]\ttrain-rmse:201.214\ttest-rmse:129.022\ttrain-my_eval:57.2723\ttest-my_eval:149.663\n",
      "[816]\ttrain-rmse:201.214\ttest-rmse:129.021\ttrain-my_eval:57.2648\ttest-my_eval:149.679\n",
      "[817]\ttrain-rmse:201.213\ttest-rmse:129.021\ttrain-my_eval:57.258\ttest-my_eval:149.652\n",
      "[818]\ttrain-rmse:201.213\ttest-rmse:129.021\ttrain-my_eval:57.2433\ttest-my_eval:149.633\n",
      "[819]\ttrain-rmse:201.213\ttest-rmse:129.021\ttrain-my_eval:57.2359\ttest-my_eval:149.637\n",
      "[820]\ttrain-rmse:201.213\ttest-rmse:129.021\ttrain-my_eval:57.2342\ttest-my_eval:149.627\n",
      "[821]\ttrain-rmse:201.212\ttest-rmse:129.02\ttrain-my_eval:57.2232\ttest-my_eval:149.607\n",
      "[822]\ttrain-rmse:201.212\ttest-rmse:129.02\ttrain-my_eval:57.2288\ttest-my_eval:149.63\n",
      "[823]\ttrain-rmse:201.212\ttest-rmse:129.019\ttrain-my_eval:57.2275\ttest-my_eval:149.675\n",
      "[824]\ttrain-rmse:201.211\ttest-rmse:129.019\ttrain-my_eval:57.2256\ttest-my_eval:149.671\n",
      "[825]\ttrain-rmse:201.211\ttest-rmse:129.018\ttrain-my_eval:57.2256\ttest-my_eval:149.672\n",
      "[826]\ttrain-rmse:201.21\ttest-rmse:129.018\ttrain-my_eval:57.2361\ttest-my_eval:149.71\n",
      "[827]\ttrain-rmse:201.21\ttest-rmse:129.017\ttrain-my_eval:57.2309\ttest-my_eval:149.879\n",
      "[828]\ttrain-rmse:201.21\ttest-rmse:129.017\ttrain-my_eval:57.2351\ttest-my_eval:149.9\n",
      "[829]\ttrain-rmse:201.209\ttest-rmse:129.016\ttrain-my_eval:57.2345\ttest-my_eval:149.891\n",
      "[830]\ttrain-rmse:201.209\ttest-rmse:129.016\ttrain-my_eval:57.2297\ttest-my_eval:149.895\n",
      "[831]\ttrain-rmse:201.209\ttest-rmse:129.015\ttrain-my_eval:57.2258\ttest-my_eval:149.888\n",
      "[832]\ttrain-rmse:201.208\ttest-rmse:129.015\ttrain-my_eval:57.2385\ttest-my_eval:149.921\n",
      "[833]\ttrain-rmse:201.208\ttest-rmse:129.015\ttrain-my_eval:57.2429\ttest-my_eval:149.936\n",
      "[834]\ttrain-rmse:201.207\ttest-rmse:129.014\ttrain-my_eval:57.241\ttest-my_eval:149.933\n",
      "[835]\ttrain-rmse:201.207\ttest-rmse:129.014\ttrain-my_eval:57.2423\ttest-my_eval:149.926\n",
      "[836]\ttrain-rmse:201.207\ttest-rmse:129.014\ttrain-my_eval:57.2321\ttest-my_eval:150.008\n",
      "[837]\ttrain-rmse:201.206\ttest-rmse:129.013\ttrain-my_eval:57.2287\ttest-my_eval:150.001\n",
      "[838]\ttrain-rmse:201.206\ttest-rmse:129.013\ttrain-my_eval:57.2238\ttest-my_eval:149.995\n",
      "[839]\ttrain-rmse:201.206\ttest-rmse:129.013\ttrain-my_eval:57.211\ttest-my_eval:149.943\n",
      "[840]\ttrain-rmse:201.205\ttest-rmse:129.012\ttrain-my_eval:57.2141\ttest-my_eval:149.965\n",
      "[841]\ttrain-rmse:201.205\ttest-rmse:129.012\ttrain-my_eval:57.2098\ttest-my_eval:149.973\n",
      "[842]\ttrain-rmse:201.205\ttest-rmse:129.012\ttrain-my_eval:57.2007\ttest-my_eval:149.959\n",
      "[843]\ttrain-rmse:201.204\ttest-rmse:129.011\ttrain-my_eval:57.1875\ttest-my_eval:150.049\n",
      "[844]\ttrain-rmse:201.204\ttest-rmse:129.011\ttrain-my_eval:57.1833\ttest-my_eval:150.051\n",
      "[845]\ttrain-rmse:201.203\ttest-rmse:129.01\ttrain-my_eval:57.1603\ttest-my_eval:150.006\n",
      "[846]\ttrain-rmse:201.203\ttest-rmse:129.01\ttrain-my_eval:57.1618\ttest-my_eval:150.007\n",
      "[847]\ttrain-rmse:201.202\ttest-rmse:129.009\ttrain-my_eval:57.1633\ttest-my_eval:150.034\n",
      "[848]\ttrain-rmse:201.202\ttest-rmse:129.008\ttrain-my_eval:57.1537\ttest-my_eval:150.022\n",
      "[849]\ttrain-rmse:201.201\ttest-rmse:129.008\ttrain-my_eval:57.1492\ttest-my_eval:150.021\n",
      "[850]\ttrain-rmse:201.201\ttest-rmse:129.007\ttrain-my_eval:57.1412\ttest-my_eval:150.178\n",
      "[851]\ttrain-rmse:201.201\ttest-rmse:129.007\ttrain-my_eval:57.136\ttest-my_eval:150.157\n",
      "[852]\ttrain-rmse:201.2\ttest-rmse:129.007\ttrain-my_eval:57.122\ttest-my_eval:150.144\n",
      "[853]\ttrain-rmse:201.2\ttest-rmse:129.007\ttrain-my_eval:57.1158\ttest-my_eval:150.126\n",
      "[854]\ttrain-rmse:201.2\ttest-rmse:129.006\ttrain-my_eval:57.1161\ttest-my_eval:150.136\n",
      "[855]\ttrain-rmse:201.199\ttest-rmse:129.006\ttrain-my_eval:57.11\ttest-my_eval:150.132\n",
      "[856]\ttrain-rmse:201.199\ttest-rmse:129.006\ttrain-my_eval:57.1182\ttest-my_eval:150.161\n",
      "[857]\ttrain-rmse:201.199\ttest-rmse:129.006\ttrain-my_eval:57.1077\ttest-my_eval:150.149\n",
      "[858]\ttrain-rmse:201.198\ttest-rmse:129.005\ttrain-my_eval:57.1098\ttest-my_eval:150.153\n",
      "[859]\ttrain-rmse:201.198\ttest-rmse:129.004\ttrain-my_eval:57.1255\ttest-my_eval:150.18\n",
      "[860]\ttrain-rmse:201.198\ttest-rmse:129.004\ttrain-my_eval:57.1202\ttest-my_eval:150.273\n",
      "[861]\ttrain-rmse:201.197\ttest-rmse:129.004\ttrain-my_eval:57.1153\ttest-my_eval:150.283\n",
      "[862]\ttrain-rmse:201.197\ttest-rmse:129.004\ttrain-my_eval:57.111\ttest-my_eval:150.274\n",
      "[863]\ttrain-rmse:201.196\ttest-rmse:129.003\ttrain-my_eval:57.0982\ttest-my_eval:150.216\n",
      "[864]\ttrain-rmse:201.196\ttest-rmse:129.002\ttrain-my_eval:57.0932\ttest-my_eval:150.235\n",
      "[865]\ttrain-rmse:201.196\ttest-rmse:129.002\ttrain-my_eval:57.0923\ttest-my_eval:150.235\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[866]\ttrain-rmse:201.195\ttest-rmse:129.001\ttrain-my_eval:57.102\ttest-my_eval:150.281\n",
      "[867]\ttrain-rmse:201.194\ttest-rmse:129.001\ttrain-my_eval:57.1017\ttest-my_eval:150.288\n",
      "[868]\ttrain-rmse:201.194\ttest-rmse:129\ttrain-my_eval:57.1005\ttest-my_eval:150.279\n",
      "[869]\ttrain-rmse:201.194\ttest-rmse:129\ttrain-my_eval:57.0868\ttest-my_eval:150.267\n",
      "[870]\ttrain-rmse:201.193\ttest-rmse:128.999\ttrain-my_eval:57.0887\ttest-my_eval:150.271\n",
      "[871]\ttrain-rmse:201.192\ttest-rmse:128.998\ttrain-my_eval:57.0898\ttest-my_eval:150.279\n",
      "[872]\ttrain-rmse:201.192\ttest-rmse:128.998\ttrain-my_eval:57.0882\ttest-my_eval:150.278\n",
      "[873]\ttrain-rmse:201.192\ttest-rmse:128.998\ttrain-my_eval:57.0861\ttest-my_eval:150.29\n",
      "[874]\ttrain-rmse:201.191\ttest-rmse:128.997\ttrain-my_eval:57.08\ttest-my_eval:150.289\n",
      "[875]\ttrain-rmse:201.191\ttest-rmse:128.997\ttrain-my_eval:57.0704\ttest-my_eval:150.284\n",
      "[876]\ttrain-rmse:201.191\ttest-rmse:128.997\ttrain-my_eval:57.0683\ttest-my_eval:150.212\n",
      "[877]\ttrain-rmse:201.191\ttest-rmse:128.996\ttrain-my_eval:57.0618\ttest-my_eval:150.222\n",
      "[878]\ttrain-rmse:201.191\ttest-rmse:128.996\ttrain-my_eval:57.0478\ttest-my_eval:150.201\n",
      "[879]\ttrain-rmse:201.19\ttest-rmse:128.995\ttrain-my_eval:57.0536\ttest-my_eval:150.2\n",
      "[880]\ttrain-rmse:201.19\ttest-rmse:128.995\ttrain-my_eval:57.0592\ttest-my_eval:150.199\n",
      "[881]\ttrain-rmse:201.189\ttest-rmse:128.994\ttrain-my_eval:57.0591\ttest-my_eval:150.261\n",
      "[882]\ttrain-rmse:201.189\ttest-rmse:128.994\ttrain-my_eval:57.0518\ttest-my_eval:150.268\n",
      "[883]\ttrain-rmse:201.188\ttest-rmse:128.993\ttrain-my_eval:57.0537\ttest-my_eval:150.247\n",
      "[884]\ttrain-rmse:201.188\ttest-rmse:128.992\ttrain-my_eval:57.0589\ttest-my_eval:150.266\n",
      "[885]\ttrain-rmse:201.187\ttest-rmse:128.992\ttrain-my_eval:57.0558\ttest-my_eval:150.25\n",
      "[886]\ttrain-rmse:201.187\ttest-rmse:128.991\ttrain-my_eval:57.0498\ttest-my_eval:150.229\n",
      "[887]\ttrain-rmse:201.187\ttest-rmse:128.991\ttrain-my_eval:57.0489\ttest-my_eval:150.21\n",
      "[888]\ttrain-rmse:201.187\ttest-rmse:128.991\ttrain-my_eval:57.0539\ttest-my_eval:150.23\n",
      "[889]\ttrain-rmse:201.186\ttest-rmse:128.99\ttrain-my_eval:57.0457\ttest-my_eval:150.236\n",
      "[890]\ttrain-rmse:201.186\ttest-rmse:128.99\ttrain-my_eval:57.0324\ttest-my_eval:150.267\n",
      "[891]\ttrain-rmse:201.186\ttest-rmse:128.99\ttrain-my_eval:57.0295\ttest-my_eval:150.279\n",
      "[892]\ttrain-rmse:201.186\ttest-rmse:128.99\ttrain-my_eval:57.02\ttest-my_eval:150.273\n",
      "[893]\ttrain-rmse:201.185\ttest-rmse:128.99\ttrain-my_eval:57.0133\ttest-my_eval:150.287\n",
      "[894]\ttrain-rmse:201.185\ttest-rmse:128.989\ttrain-my_eval:57.0236\ttest-my_eval:150.315\n",
      "[895]\ttrain-rmse:201.184\ttest-rmse:128.989\ttrain-my_eval:57.0163\ttest-my_eval:150.322\n",
      "[896]\ttrain-rmse:201.184\ttest-rmse:128.988\ttrain-my_eval:57.0081\ttest-my_eval:150.33\n",
      "[897]\ttrain-rmse:201.183\ttest-rmse:128.988\ttrain-my_eval:56.9965\ttest-my_eval:150.326\n",
      "[898]\ttrain-rmse:201.183\ttest-rmse:128.987\ttrain-my_eval:56.993\ttest-my_eval:150.331\n",
      "[899]\ttrain-rmse:201.183\ttest-rmse:128.987\ttrain-my_eval:56.9844\ttest-my_eval:150.328\n",
      "[900]\ttrain-rmse:201.183\ttest-rmse:128.987\ttrain-my_eval:56.9883\ttest-my_eval:150.36\n",
      "[901]\ttrain-rmse:201.182\ttest-rmse:128.986\ttrain-my_eval:56.9852\ttest-my_eval:150.36\n",
      "[902]\ttrain-rmse:201.182\ttest-rmse:128.986\ttrain-my_eval:56.9786\ttest-my_eval:150.349\n",
      "[903]\ttrain-rmse:201.181\ttest-rmse:128.985\ttrain-my_eval:56.9814\ttest-my_eval:150.394\n",
      "[904]\ttrain-rmse:201.181\ttest-rmse:128.985\ttrain-my_eval:56.98\ttest-my_eval:150.479\n",
      "[905]\ttrain-rmse:201.18\ttest-rmse:128.984\ttrain-my_eval:56.9772\ttest-my_eval:150.478\n",
      "[906]\ttrain-rmse:201.18\ttest-rmse:128.984\ttrain-my_eval:56.974\ttest-my_eval:150.426\n",
      "[907]\ttrain-rmse:201.179\ttest-rmse:128.983\ttrain-my_eval:56.959\ttest-my_eval:150.385\n",
      "[908]\ttrain-rmse:201.179\ttest-rmse:128.983\ttrain-my_eval:56.9545\ttest-my_eval:150.373\n",
      "[909]\ttrain-rmse:201.179\ttest-rmse:128.982\ttrain-my_eval:56.9534\ttest-my_eval:150.361\n",
      "[910]\ttrain-rmse:201.179\ttest-rmse:128.982\ttrain-my_eval:56.9436\ttest-my_eval:150.392\n",
      "[911]\ttrain-rmse:201.178\ttest-rmse:128.981\ttrain-my_eval:56.9501\ttest-my_eval:150.426\n",
      "[912]\ttrain-rmse:201.178\ttest-rmse:128.981\ttrain-my_eval:56.9495\ttest-my_eval:150.425\n",
      "[913]\ttrain-rmse:201.178\ttest-rmse:128.981\ttrain-my_eval:56.9509\ttest-my_eval:150.434\n",
      "[914]\ttrain-rmse:201.177\ttest-rmse:128.98\ttrain-my_eval:56.9554\ttest-my_eval:150.47\n",
      "[915]\ttrain-rmse:201.177\ttest-rmse:128.98\ttrain-my_eval:56.9358\ttest-my_eval:150.428\n",
      "[916]\ttrain-rmse:201.176\ttest-rmse:128.98\ttrain-my_eval:56.9395\ttest-my_eval:150.47\n",
      "[917]\ttrain-rmse:201.176\ttest-rmse:128.979\ttrain-my_eval:56.9445\ttest-my_eval:150.522\n",
      "[918]\ttrain-rmse:201.176\ttest-rmse:128.979\ttrain-my_eval:56.9462\ttest-my_eval:150.583\n",
      "[919]\ttrain-rmse:201.176\ttest-rmse:128.978\ttrain-my_eval:56.9432\ttest-my_eval:150.597\n",
      "[920]\ttrain-rmse:201.175\ttest-rmse:128.979\ttrain-my_eval:56.9345\ttest-my_eval:150.575\n",
      "[921]\ttrain-rmse:201.175\ttest-rmse:128.978\ttrain-my_eval:56.9384\ttest-my_eval:150.605\n",
      "[922]\ttrain-rmse:201.174\ttest-rmse:128.977\ttrain-my_eval:56.9385\ttest-my_eval:150.605\n",
      "[923]\ttrain-rmse:201.174\ttest-rmse:128.977\ttrain-my_eval:56.9486\ttest-my_eval:150.651\n",
      "[924]\ttrain-rmse:201.173\ttest-rmse:128.976\ttrain-my_eval:56.9493\ttest-my_eval:150.668\n",
      "[925]\ttrain-rmse:201.173\ttest-rmse:128.976\ttrain-my_eval:56.9528\ttest-my_eval:150.68\n",
      "[926]\ttrain-rmse:201.172\ttest-rmse:128.975\ttrain-my_eval:56.9548\ttest-my_eval:150.687\n",
      "[927]\ttrain-rmse:201.172\ttest-rmse:128.975\ttrain-my_eval:56.9631\ttest-my_eval:150.71\n",
      "[928]\ttrain-rmse:201.172\ttest-rmse:128.974\ttrain-my_eval:56.9528\ttest-my_eval:150.702\n",
      "[929]\ttrain-rmse:201.171\ttest-rmse:128.974\ttrain-my_eval:56.9302\ttest-my_eval:150.65\n",
      "[930]\ttrain-rmse:201.171\ttest-rmse:128.974\ttrain-my_eval:56.9237\ttest-my_eval:150.644\n",
      "[931]\ttrain-rmse:201.17\ttest-rmse:128.973\ttrain-my_eval:56.9316\ttest-my_eval:150.692\n",
      "[932]\ttrain-rmse:201.17\ttest-rmse:128.973\ttrain-my_eval:56.9191\ttest-my_eval:150.692\n",
      "[933]\ttrain-rmse:201.17\ttest-rmse:128.973\ttrain-my_eval:56.9084\ttest-my_eval:150.69\n",
      "[934]\ttrain-rmse:201.17\ttest-rmse:128.972\ttrain-my_eval:56.9003\ttest-my_eval:150.698\n",
      "[935]\ttrain-rmse:201.169\ttest-rmse:128.972\ttrain-my_eval:56.9019\ttest-my_eval:150.701\n",
      "[936]\ttrain-rmse:201.169\ttest-rmse:128.971\ttrain-my_eval:56.9062\ttest-my_eval:150.718\n",
      "[937]\ttrain-rmse:201.169\ttest-rmse:128.971\ttrain-my_eval:56.9014\ttest-my_eval:150.675\n",
      "[938]\ttrain-rmse:201.168\ttest-rmse:128.971\ttrain-my_eval:56.8933\ttest-my_eval:150.674\n",
      "[939]\ttrain-rmse:201.168\ttest-rmse:128.971\ttrain-my_eval:56.8937\ttest-my_eval:150.673\n",
      "[940]\ttrain-rmse:201.168\ttest-rmse:128.97\ttrain-my_eval:56.8965\ttest-my_eval:150.643\n",
      "[941]\ttrain-rmse:201.167\ttest-rmse:128.97\ttrain-my_eval:56.8876\ttest-my_eval:150.625\n",
      "[942]\ttrain-rmse:201.167\ttest-rmse:128.969\ttrain-my_eval:56.8921\ttest-my_eval:150.668\n",
      "[943]\ttrain-rmse:201.167\ttest-rmse:128.969\ttrain-my_eval:56.8851\ttest-my_eval:150.654\n",
      "[944]\ttrain-rmse:201.166\ttest-rmse:128.968\ttrain-my_eval:56.88\ttest-my_eval:150.593\n",
      "[945]\ttrain-rmse:201.166\ttest-rmse:128.968\ttrain-my_eval:56.8746\ttest-my_eval:150.601\n",
      "[946]\ttrain-rmse:201.166\ttest-rmse:128.968\ttrain-my_eval:56.8739\ttest-my_eval:150.601\n",
      "[947]\ttrain-rmse:201.165\ttest-rmse:128.967\ttrain-my_eval:56.8638\ttest-my_eval:150.572\n",
      "[948]\ttrain-rmse:201.165\ttest-rmse:128.967\ttrain-my_eval:56.8729\ttest-my_eval:150.581\n",
      "[949]\ttrain-rmse:201.165\ttest-rmse:128.967\ttrain-my_eval:56.8677\ttest-my_eval:150.584\n",
      "[950]\ttrain-rmse:201.164\ttest-rmse:128.966\ttrain-my_eval:56.8689\ttest-my_eval:150.583\n",
      "[951]\ttrain-rmse:201.164\ttest-rmse:128.966\ttrain-my_eval:56.8789\ttest-my_eval:150.621\n",
      "[952]\ttrain-rmse:201.163\ttest-rmse:128.965\ttrain-my_eval:56.8781\ttest-my_eval:150.63\n",
      "[953]\ttrain-rmse:201.163\ttest-rmse:128.965\ttrain-my_eval:56.8564\ttest-my_eval:150.623\n",
      "[954]\ttrain-rmse:201.163\ttest-rmse:128.965\ttrain-my_eval:56.8514\ttest-my_eval:150.62\n",
      "[955]\ttrain-rmse:201.162\ttest-rmse:128.965\ttrain-my_eval:56.8391\ttest-my_eval:150.563\n",
      "[956]\ttrain-rmse:201.162\ttest-rmse:128.964\ttrain-my_eval:56.8491\ttest-my_eval:150.586\n",
      "[957]\ttrain-rmse:201.161\ttest-rmse:128.963\ttrain-my_eval:56.8469\ttest-my_eval:150.618\n",
      "[958]\ttrain-rmse:201.161\ttest-rmse:128.963\ttrain-my_eval:56.852\ttest-my_eval:150.645\n",
      "[959]\ttrain-rmse:201.16\ttest-rmse:128.962\ttrain-my_eval:56.8566\ttest-my_eval:150.637\n",
      "[960]\ttrain-rmse:201.16\ttest-rmse:128.962\ttrain-my_eval:56.8659\ttest-my_eval:150.669\n",
      "[961]\ttrain-rmse:201.16\ttest-rmse:128.962\ttrain-my_eval:56.8604\ttest-my_eval:150.705\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[962]\ttrain-rmse:201.159\ttest-rmse:128.961\ttrain-my_eval:56.8694\ttest-my_eval:150.743\n",
      "[963]\ttrain-rmse:201.159\ttest-rmse:128.961\ttrain-my_eval:56.8602\ttest-my_eval:150.736\n",
      "[964]\ttrain-rmse:201.158\ttest-rmse:128.96\ttrain-my_eval:56.8541\ttest-my_eval:150.728\n",
      "[965]\ttrain-rmse:201.158\ttest-rmse:128.96\ttrain-my_eval:56.8514\ttest-my_eval:150.749\n",
      "[966]\ttrain-rmse:201.157\ttest-rmse:128.959\ttrain-my_eval:56.8602\ttest-my_eval:150.796\n",
      "[967]\ttrain-rmse:201.157\ttest-rmse:128.959\ttrain-my_eval:56.8572\ttest-my_eval:150.77\n",
      "[968]\ttrain-rmse:201.157\ttest-rmse:128.958\ttrain-my_eval:56.8481\ttest-my_eval:150.755\n",
      "[969]\ttrain-rmse:201.157\ttest-rmse:128.958\ttrain-my_eval:56.856\ttest-my_eval:150.773\n",
      "[970]\ttrain-rmse:201.156\ttest-rmse:128.958\ttrain-my_eval:56.8466\ttest-my_eval:150.745\n",
      "[971]\ttrain-rmse:201.156\ttest-rmse:128.958\ttrain-my_eval:56.8387\ttest-my_eval:150.764\n",
      "[972]\ttrain-rmse:201.156\ttest-rmse:128.958\ttrain-my_eval:56.8255\ttest-my_eval:150.875\n",
      "[973]\ttrain-rmse:201.155\ttest-rmse:128.957\ttrain-my_eval:56.8196\ttest-my_eval:150.936\n",
      "[974]\ttrain-rmse:201.155\ttest-rmse:128.957\ttrain-my_eval:56.8132\ttest-my_eval:150.928\n",
      "[975]\ttrain-rmse:201.155\ttest-rmse:128.957\ttrain-my_eval:56.811\ttest-my_eval:150.923\n",
      "[976]\ttrain-rmse:201.155\ttest-rmse:128.956\ttrain-my_eval:56.8043\ttest-my_eval:150.935\n",
      "[977]\ttrain-rmse:201.154\ttest-rmse:128.956\ttrain-my_eval:56.8149\ttest-my_eval:150.961\n",
      "[978]\ttrain-rmse:201.154\ttest-rmse:128.955\ttrain-my_eval:56.8137\ttest-my_eval:150.981\n",
      "[979]\ttrain-rmse:201.154\ttest-rmse:128.955\ttrain-my_eval:56.8072\ttest-my_eval:150.995\n",
      "[980]\ttrain-rmse:201.154\ttest-rmse:128.955\ttrain-my_eval:56.7997\ttest-my_eval:150.955\n",
      "[981]\ttrain-rmse:201.153\ttest-rmse:128.954\ttrain-my_eval:56.8035\ttest-my_eval:150.994\n",
      "[982]\ttrain-rmse:201.153\ttest-rmse:128.954\ttrain-my_eval:56.8034\ttest-my_eval:150.995\n",
      "[983]\ttrain-rmse:201.152\ttest-rmse:128.953\ttrain-my_eval:56.8048\ttest-my_eval:151.027\n",
      "[984]\ttrain-rmse:201.152\ttest-rmse:128.953\ttrain-my_eval:56.8041\ttest-my_eval:151.061\n",
      "[985]\ttrain-rmse:201.152\ttest-rmse:128.953\ttrain-my_eval:56.8014\ttest-my_eval:151.056\n",
      "[986]\ttrain-rmse:201.151\ttest-rmse:128.953\ttrain-my_eval:56.793\ttest-my_eval:151.04\n",
      "[987]\ttrain-rmse:201.151\ttest-rmse:128.953\ttrain-my_eval:56.8014\ttest-my_eval:151.059\n",
      "[988]\ttrain-rmse:201.151\ttest-rmse:128.952\ttrain-my_eval:56.802\ttest-my_eval:151.061\n",
      "[989]\ttrain-rmse:201.151\ttest-rmse:128.951\ttrain-my_eval:56.7911\ttest-my_eval:151.037\n",
      "[990]\ttrain-rmse:201.15\ttest-rmse:128.951\ttrain-my_eval:56.7814\ttest-my_eval:151.021\n",
      "[991]\ttrain-rmse:201.15\ttest-rmse:128.951\ttrain-my_eval:56.7662\ttest-my_eval:150.999\n",
      "[992]\ttrain-rmse:201.149\ttest-rmse:128.95\ttrain-my_eval:56.7813\ttest-my_eval:151.077\n",
      "[993]\ttrain-rmse:201.149\ttest-rmse:128.95\ttrain-my_eval:56.7724\ttest-my_eval:151.055\n",
      "[994]\ttrain-rmse:201.148\ttest-rmse:128.95\ttrain-my_eval:56.7625\ttest-my_eval:151.033\n",
      "[995]\ttrain-rmse:201.148\ttest-rmse:128.95\ttrain-my_eval:56.7702\ttest-my_eval:151.05\n",
      "[996]\ttrain-rmse:201.148\ttest-rmse:128.95\ttrain-my_eval:56.7617\ttest-my_eval:151.039\n",
      "[997]\ttrain-rmse:201.148\ttest-rmse:128.95\ttrain-my_eval:56.7581\ttest-my_eval:151.163\n",
      "[998]\ttrain-rmse:201.148\ttest-rmse:128.949\ttrain-my_eval:56.7553\ttest-my_eval:151.182\n",
      "[999]\ttrain-rmse:201.147\ttest-rmse:128.949\ttrain-my_eval:56.7454\ttest-my_eval:151.172\n",
      "xgboost success! \n",
      "cost time: 3962.99799991 (s)\n"
     ]
    }
   ],
   "source": [
    "def get_evafunc(info1,info2):\n",
    "    def evafunc(pred, dmat):\n",
    "        if pred.shape[0]==info1.shape[0]:\n",
    "            info=info1\n",
    "        if pred.shape[0]==info2.shape[0]:\n",
    "            info=info2\n",
    "        \n",
    "        op=info\n",
    "        \n",
    "        n=pred.shape[0]\n",
    "\n",
    "        label=np.array(op['quantity'])\n",
    "        i=np.array(op['sku_id'])\n",
    "        j=np.array(op['dc_id'])\n",
    "        qi=np.array(op['quantile'])\n",
    "        k1=np.array(op['k1'])\n",
    "        k2=np.array(op['k2'])\n",
    "\n",
    "        L=np.zeros((1001,6))\n",
    "        N=np.zeros((1001,6))\n",
    "        for ind in range(n):\n",
    "            if label[ind]>pred[ind]:\n",
    "                L[i[ind]][j[ind]]+=k1[ind]*(label[ind]-pred[ind])\n",
    "                N[i[ind]][j[ind]]+=1\n",
    "            else:\n",
    "                L[i[ind]][j[ind]]+=k2[ind]*(pred[ind]-label[ind])\n",
    "                N[i[ind]][j[ind]]+=1\n",
    "        ans=0\n",
    "        for i in range(1001):\n",
    "            for j in range(6):\n",
    "                if N[i][j]!=0:\n",
    "                    ans+=L[i][j]/N[i][j]\n",
    "        myeval=ans\n",
    "        return 'my_eval',myeval\n",
    "    return evafunc\n",
    "def get_loss(info1,info2):\n",
    "    def lossfunc(pred, dmat): #自定义损失函数\n",
    "        if pred.shape[0]==info1.shape[0]:\n",
    "            info=info1\n",
    "        if pred.shape[0]==info2.shape[0]:\n",
    "            info=info2\n",
    "        n=pred.shape[0]\n",
    "        \n",
    "        delta=pred-np.array(info['quantity'])\n",
    "        k1=np.array(info.k1)\n",
    "        k2=np.array(info.k2)\n",
    "        import math\n",
    "        qiudao1=np.zeros(n)\n",
    "        qiudao2=np.zeros(n)\n",
    "        for i in range(n):\n",
    "            e_delta=math.exp(delta[i])\n",
    "            qiudao1[i]=(-k1[i]-k2[i])/(1+e_delta)+k2[i]\n",
    "            qiudao2[i]=(k1[i]+k2[i])/((1+e_delta)**2)*e_delta\n",
    "        grad=qiudao1 #梯度\n",
    "        hess=qiudao2\n",
    "        return grad,hess\n",
    "    return lossfunc\n",
    "\n",
    "import xgboost as xgb\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "#from xgboost.sklearn import XGBClassifier\n",
    "#from sklearn import cross_validation,metrics\n",
    "#from sklearn.grid_search import GridSearchCV\n",
    "\n",
    "import time \n",
    "start_time = time.time()\n",
    "params={\n",
    "'booster':'gbtree',\n",
    "#'objective': 'reg:linear', #线性回归的问题\n",
    "#'eval_metric':'auc',\n",
    "'gamma':0.15,  # 用于控制是否后剪枝的参数,越大越保守，一般0.1、0.2这样子。\n",
    "'min_child_weight':3,\n",
    "'max_depth':5, # 构建树的深度，越大越容易过拟合\n",
    "'lambda':10,  # 控制模型复杂度的权重值的L2正则化项参数，参数越大，模型越不容易过拟合。\n",
    "'subsample':0.7, # 随机采样训练样本#0.7\n",
    "'colsample_bytree':0.7, # 生成树时进行的列采样#0.7\n",
    "'colsample_bylevel':0.7,\n",
    "#'min_child_weight':3, \n",
    "# 这个参数默认是 1，是每个叶子里面 h 的和至少是多少，对正负样本不均衡时的 0-1 分类而言\n",
    "#，假设 h 在 0.01 附近，min_child_weight 为 1 意味着叶子节点中最少需要包含 100 个样本。\n",
    "#这个参数非常影响结果，控制叶子节点中二阶导的和的最小值，该参数值越小，越容易 overfitting。 \n",
    "'silent':0 ,#设置成1则没有运行信息输出，最好是设置为0.\n",
    "'eta': 0.1, # 如同学习率\n",
    "'tree_method':'exact',\n",
    "'seed':10,\n",
    "#'nthread':12\n",
    "#'nthread':,# cpu 线程数\n",
    "#'eval_metric': 'auc'\n",
    "}\n",
    "train_X=train1.drop(['quantity'],axis=1)\n",
    "train_Y=train1['quantity']\n",
    "\n",
    "test_X=train2.drop(['quantity'],axis=1)\n",
    "test_Y=train2['quantity']\n",
    "\n",
    "\n",
    "train_xgb=xgb.DMatrix(train_X,label=train_Y)\n",
    "test_xgb=xgb.DMatrix(test_X,label=test_Y)\n",
    "watchlist=[(train_xgb,'train'),(test_xgb,'test')]\n",
    "model=xgb.train(params,train_xgb,num_boost_round=1000,feval=get_evafunc(info1,info2),obj=get_loss(info1,info2),evals=watchlist)\n",
    "\n",
    "cost_time = time.time()-start_time\n",
    "print \"xgboost success!\",'\\n',\"cost time:\",cost_time,\"(s)\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "834\n",
      "lastmonth_dc_sku_quantity ----------------------------------- 362\n",
      "hist_dc_sku_quantity ---------------------------------------- 239\n",
      "lastmonth_brand_dc_sku_quantity ----------------------------- 213\n",
      "qi_lastmonth_dc_sku ----------------------------------------- 203\n",
      "hist_brand_sku_quantity ------------------------------------- 152\n",
      "lastmonth_brand_sku_quantity -------------------------------- 145\n",
      "qi_lastmonth_brand_sku -------------------------------------- 144\n",
      "hist_brand_dc_sku_quantity ---------------------------------- 139\n",
      "qi_brand_sku ------------------------------------------------ 115\n",
      "hist_promt_dc_sku_quantity ---------------------------------- 108\n",
      "qi_lastmonth_brand_dc_sku ----------------------------------- 106\n",
      "hist_sku_quantity ------------------------------------------- 96\n",
      "lastmonth_sku_quantity -------------------------------------- 71\n",
      "qi_lastmonth_sku -------------------------------------------- 65\n",
      "qi_sku ------------------------------------------------------ 57\n",
      "hist_brand_promt_dc_third_quantity -------------------------- 56\n",
      "lastmonth_brand_sku_vend ------------------------------------ 56\n",
      "now_date_values_rate ---------------------------------------- 55\n",
      "hist_promt_sku_quantity ------------------------------------- 51\n",
      "qi_dc_sku --------------------------------------------------- 49\n",
      "hist_brand_promt_third_quantity ----------------------------- 47\n",
      "qi_promt_dc_sku --------------------------------------------- 47\n",
      "now_date_prom_6 --------------------------------------------- 47\n",
      "hist_brand_promt_dc_sku_quantity ---------------------------- 46\n",
      "now_date_first_prom_6 --------------------------------------- 41\n",
      "qi_promt_sku ------------------------------------------------ 40\n",
      "lastmonth_brand_sku_discount -------------------------------- 38\n",
      "hist_promt_dc_third_quantity -------------------------------- 38\n",
      "qi_brand_dc_sku --------------------------------------------- 37\n",
      "now_date_dc_prom_1 ------------------------------------------ 36\n",
      "hist_brand_third_prom_1 ------------------------------------- 36\n",
      "hist_brand_sku_discount ------------------------------------- 36\n",
      "lastmonth_brand_dc_third_quantity --------------------------- 34\n",
      "lastmonth_promt_third_quantity ------------------------------ 34\n",
      "now_date_prom_1 --------------------------------------------- 34\n",
      "lastmonth_promt_sku_quantity -------------------------------- 32\n",
      "hist_brand_third_quantity ----------------------------------- 32\n",
      "lastmonth_promt_dc_sku_quantity ----------------------------- 31\n",
      "lastmonth_dc_third_quantity --------------------------------- 31\n",
      "lastmonth_sku_vend ------------------------------------------ 31\n",
      "hist_brand_sku_prom_10 -------------------------------------- 30\n",
      "now_date_attr ----------------------------------------------- 29\n",
      "lastmonth_dc_second_quantity -------------------------------- 29\n",
      "lastmonth_brand_quantity ------------------------------------ 25\n",
      "lastmonth_promt_dc_third_quantity --------------------------- 25\n",
      "hist_promt_second_discount ---------------------------------- 24\n",
      "qi_brand_promt_sku ------------------------------------------ 24\n",
      "hist_brand_sku_prom_1 --------------------------------------- 24\n",
      "hist_brand_promt_second_quantity ---------------------------- 23\n",
      "hist_brand_promt_first_quantity ----------------------------- 22\n",
      "hist_brand_dc_third_quantity -------------------------------- 22\n",
      "hist_brand_second_prom_times -------------------------------- 22\n",
      "qi_lastmonth_promt_sku -------------------------------------- 22\n",
      "hist_brand_second_discount ---------------------------------- 21\n",
      "now_date_dc_first_prom_1 ------------------------------------ 21\n",
      "lastmonth_brand_promt_dc_sku_quantity ----------------------- 21\n",
      "hist_promt_dc_quantity -------------------------------------- 21\n",
      "now_date_second_prom_1 -------------------------------------- 20\n",
      "qi_lastmonth_brand ------------------------------------------ 20\n",
      "now_date_first_prom_1 --------------------------------------- 19\n",
      "hist_brand_sku_prom_ok -------------------------------------- 18\n",
      "lastmonth_brand_promt_sku_quantity -------------------------- 18\n",
      "hist_brand_promt_quantity ----------------------------------- 18\n",
      "lastmonth_sku_discount -------------------------------------- 18\n",
      "lastmonth_third_quantity ------------------------------------ 18\n",
      "lastmonth_brand_sku_or_price -------------------------------- 18\n",
      "qi_lastmonth_brand_second ----------------------------------- 18\n",
      "now_date_dc_third_prom_ok ----------------------------------- 18\n",
      "qi_lastmonth_brand_third ------------------------------------ 17\n",
      "qi_brand_third ---------------------------------------------- 17\n",
      "qi_brand_promt_dc_first ------------------------------------- 17\n",
      "qi_lastmonth_promt_dc_sku ----------------------------------- 17\n",
      "lastmonth_promt_dc_second_quantity -------------------------- 17\n",
      "lastmonth_dc_sku_or_price ----------------------------------- 17\n",
      "hist_brand_promt_sku_quantity ------------------------------- 17\n",
      "qi_lastmonth_promt_dc_third --------------------------------- 17\n",
      "qi_brand_promt_dc ------------------------------------------- 16\n",
      "now_date_first_prom_times ----------------------------------- 16\n",
      "lastmonth_promt_dc_first_quantity --------------------------- 16\n",
      "qi_lastmonth_brand_promt_third ------------------------------ 16\n",
      "hist_brand_dc_third_discount -------------------------------- 16\n",
      "hist_promt_dc_second_values_rate ---------------------------- 16\n",
      "now_brand_prom_1 -------------------------------------------- 16\n",
      "lastmonth_brand_discount ------------------------------------ 15\n",
      "hist_promt_third_quantity ----------------------------------- 15\n",
      "now_date_dc_prom_6 ------------------------------------------ 15\n",
      "lastmonth_brand_third_quantity ------------------------------ 15\n",
      "hist_brand_third_prom_times --------------------------------- 15\n",
      "now_date_dc_second_prom_1 ----------------------------------- 15\n",
      "hist_brand_third_discount ----------------------------------- 15\n",
      "qi_lastmonth_brand_dc_third --------------------------------- 15\n",
      "now_date_prom_10 -------------------------------------------- 15\n",
      "qi_lastmonth_third ------------------------------------------ 15\n",
      "hist_third_prom_6 ------------------------------------------- 14\n",
      "lastmonth_dc_sku_discount ----------------------------------- 14\n",
      "lastmonth_brand_dc_second_quantity -------------------------- 14\n",
      "lastmonth_brand_third_discount ------------------------------ 14\n",
      "now_sku_prom_10 --------------------------------------------- 14\n",
      "qi_lastmonth_dc_third --------------------------------------- 14\n",
      "hist_dc_third_quantity -------------------------------------- 14\n",
      "now_date_promt_first_attr_values ---------------------------- 14\n",
      "qi_lastmonth_promt_third ------------------------------------ 13\n",
      "qi_brand_promt_dc_sku --------------------------------------- 13\n",
      "hist_brand_second_vend -------------------------------------- 13\n",
      "lastmonth_brand_first_quantity ------------------------------ 13\n",
      "qi_brand_promt_dc_third ------------------------------------- 13\n",
      "lastmonth_dc_third_or_price --------------------------------- 13\n",
      "lastmonth_brand_dc_third_or_price --------------------------- 13\n",
      "hist_promt_third_discount ----------------------------------- 13\n",
      "hist_brand_sku_prom_6 --------------------------------------- 13\n",
      "lastmonth_brand_dc_second_or_price -------------------------- 12\n",
      "hist_brand_dc_quantity -------------------------------------- 12\n",
      "lastmonth_brand_sku_prom_10 --------------------------------- 12\n",
      "lastmonth_brand_dc_prom_10 ---------------------------------- 12\n",
      "now_date_second_prom_times ---------------------------------- 12\n",
      "lastmonth_brand_dc_third_prom_10 ---------------------------- 12\n",
      "hist_brand_sku_prom_times ----------------------------------- 12\n",
      "qi_lastmonth_promt_dc_second -------------------------------- 12\n",
      "now_sku_prom_1 ---------------------------------------------- 12\n",
      "hist_brand_discount ----------------------------------------- 12\n",
      "hist_sku_discount ------------------------------------------- 11\n",
      "hist_brand_third_or_price ----------------------------------- 11\n",
      "lastmonth_promt_sku_discount -------------------------------- 11\n",
      "hist_dc_third_prom_6 ---------------------------------------- 11\n",
      "lastmonth_brand_promt_quantity ------------------------------ 11\n",
      "hist_brand_second_prom_1 ------------------------------------ 11\n",
      "hist_brand_dc_second_quantity ------------------------------- 11\n",
      "qi_brand ---------------------------------------------------- 11\n",
      "lastmonth_brand_first_discount ------------------------------ 11\n",
      "hist_brand_dc_vend ------------------------------------------ 11\n",
      "hist_brand_sku_or_price ------------------------------------- 11\n",
      "hist_dc_sku_or_price ---------------------------------------- 11\n",
      "hist_brand_promt_dc_discount -------------------------------- 11\n",
      "qi_lastmonth_brand_promt_sku -------------------------------- 10\n",
      "hist_promt_sku_or_price ------------------------------------- 10\n",
      "lastmonth_promt_dc_sku_vend --------------------------------- 10\n",
      "hist_brand_dc_second_discount ------------------------------- 10\n",
      "lastmonth_brand_dc_third_prom_1 ----------------------------- 10\n",
      "qi_lastmonth_brand_promt_dc_sku ----------------------------- 10\n",
      "hist_brand_dc_first_quantity -------------------------------- 10\n",
      "now_date_dc_first_prom_6 ------------------------------------ 10\n",
      "hist_third_or_price ----------------------------------------- 10\n",
      "hist_brand_prom_times --------------------------------------- 10\n",
      "hist_promt_sku_vend ----------------------------------------- 10\n",
      "hist_brand_promt_dc_first_discount -------------------------- 10\n",
      "qi_lastmonth_brand_promt_first ------------------------------ 10\n",
      "lastmonth_brand_dc_second_discount -------------------------- 10\n",
      "now_brand_third_prom_1 -------------------------------------- 10\n",
      "qi_lastmonth_brand_promt ------------------------------------ 10\n",
      "hist_brand_promt_or_price ----------------------------------- 10\n",
      "now_date_third_prom_ok -------------------------------------- 10\n",
      "lastmonth_dc_third_prom_1 ----------------------------------- 9\n",
      "hist_brand_promt_sku_discount ------------------------------- 9\n",
      "hist_dc_third_or_price -------------------------------------- 9\n",
      "now_date_promt_dc_first_attr_values ------------------------- 9\n",
      "lastmonth_brand_sku_prom_ok --------------------------------- 9\n",
      "hist_brand_promt_discount ----------------------------------- 9\n",
      "lastmonth_brand_promt_dc_third_quantity --------------------- 9\n",
      "lastmonth_brand_prom_10 ------------------------------------- 9\n",
      "hist_brand_third_vend --------------------------------------- 9\n",
      "lastmonth_third_prom_6 -------------------------------------- 9\n",
      "hist_brand_second_quantity ---------------------------------- 9\n",
      "qi_lastmonth_promt_dc_first --------------------------------- 9\n",
      "lastmonth_brand_dc_second_prom_times ------------------------ 9\n",
      "hist_brand_sku_vend ----------------------------------------- 9\n",
      "qi_lastmonth_brand_dc_second -------------------------------- 9\n",
      "hist_dc_sku_prom_times -------------------------------------- 9\n",
      "hist_brand_promt_third_attr_values -------------------------- 9\n",
      "hist_brand_dc_second_prom_6 --------------------------------- 9\n",
      "qi_lastmonth_promt_dc --------------------------------------- 9\n",
      "hist_sku_prom_10 -------------------------------------------- 8\n",
      "now_dc_sku_prom_1 ------------------------------------------- 8\n",
      "hist_third_prom_4 ------------------------------------------- 8\n",
      "now_date_promt_second_values_rate --------------------------- 8\n",
      "hist_brand_third_attr_values -------------------------------- 8\n",
      "now_date_second_attr_values --------------------------------- 8\n",
      "lastmonth_sku_or_price -------------------------------------- 8\n",
      "now_date_dc_prom_10 ----------------------------------------- 8\n",
      "hist_brand_dc_third_prom_times ------------------------------ 8\n",
      "lastmonth_brand_promt_second_quantity ----------------------- 8\n",
      "hist_brand_promt_third_or_price ----------------------------- 8\n",
      "now_date_first_prom_4 --------------------------------------- 8\n",
      "hist_brand_third_prom_ok ------------------------------------ 8\n",
      "lastmonth_brand_promt_dc_second_quantity -------------------- 8\n",
      "lastmonth_brand_sku_prom_times ------------------------------ 8\n",
      "lastmonth_brand_dc_first_quantity --------------------------- 8\n",
      "hist_third_quantity ----------------------------------------- 8\n",
      "lastmonth_promt_dc_first_vend ------------------------------- 8\n",
      "hist_brand_promt_third_discount ----------------------------- 8\n",
      "lastmonth_brand_third_prom_10 ------------------------------- 8\n",
      "now_date_dc_second_prom_10 ---------------------------------- 8\n",
      "lastmonth_brand_first_prom_10 ------------------------------- 8\n",
      "hist_promt_dc_first_attr_values ----------------------------- 8\n",
      "hist_brand_promt_dc_second_quantity ------------------------- 8\n",
      "qi_lastmonth_brand_dc --------------------------------------- 8\n",
      "qi_promt_dc_second ------------------------------------------ 8\n",
      "qi_promt_third ---------------------------------------------- 8\n",
      "hist_sku_prom_ok -------------------------------------------- 8\n",
      "lastmonth_brand_dc_sku_discount ----------------------------- 8\n",
      "hist_brand_promt_dc_third_discount -------------------------- 8\n",
      "now_date_promt_dc_attr -------------------------------------- 8\n",
      "lastmonth_promt_dc_first_or_price --------------------------- 8\n",
      "lastmonth_promt_dc_third_or_price --------------------------- 8\n",
      "now_date_prom_times ----------------------------------------- 8\n",
      "hist_dc_second_values_rate ---------------------------------- 8\n",
      "hist_brand_dc_second_prom_times ----------------------------- 8\n",
      "hist_dc_third_values_rate ----------------------------------- 8\n",
      "hist_brand_dc_third_prom_6 ---------------------------------- 8\n",
      "hist_brand_dc_third_prom_1 ---------------------------------- 8\n",
      "now_dc_third_values_rate ------------------------------------ 7\n",
      "lastmonth_promt_sku_vend ------------------------------------ 7\n",
      "now_date_dc_attr_values ------------------------------------- 7\n",
      "qi_brand_second --------------------------------------------- 7\n",
      "now_date_third_values_rate ---------------------------------- 7\n",
      "lastmonth_brand_second_discount ----------------------------- 7\n",
      "qi_brand_promt_dc_second ------------------------------------ 7\n",
      "now_date_dc_second_values_rate ------------------------------ 7\n",
      "now_date_attr_values ---------------------------------------- 7\n",
      "hist_promt_dc_first_quantity -------------------------------- 7\n",
      "hist_brand_dc_third_or_price -------------------------------- 7\n",
      "now_date_first_attr_values ---------------------------------- 7\n",
      "now_date_first_attr ----------------------------------------- 7\n",
      "lastmonth_brand_second_quantity ----------------------------- 7\n",
      "hist_dc_sku_vend -------------------------------------------- 7\n",
      "lastmonth_brand_promt_dc_or_price --------------------------- 7\n",
      "qi_promt_dc_third ------------------------------------------- 7\n",
      "qi_lastmonth_brand_first ------------------------------------ 7\n",
      "now_dc_sku_prom_10 ------------------------------------------ 7\n",
      "lastmonth_promt_third_values_rate --------------------------- 7\n",
      "hist_promt_sku_attr_values ---------------------------------- 7\n",
      "qi_brand_promt_second --------------------------------------- 7\n",
      "qi_promt_dc_first ------------------------------------------- 7\n",
      "now_brand_dc_prom_times ------------------------------------- 7\n",
      "hist_brand_third_prom_6 ------------------------------------- 7\n",
      "hist_brand_or_price ----------------------------------------- 7\n",
      "hist_promt_sku_discount ------------------------------------- 7\n",
      "now_date_dc_second_prom_times ------------------------------- 7\n",
      "hist_promt_dc_third_discount -------------------------------- 7\n",
      "now_date_promt_dc_values_rate ------------------------------- 7\n",
      "hist_sku_prom_1 --------------------------------------------- 7\n",
      "hist_promt_third_vend --------------------------------------- 7\n",
      "hist_promt_second_quantity ---------------------------------- 7\n",
      "qi_brand_promt_third ---------------------------------------- 7\n",
      "hist_promt_dc_second_discount ------------------------------- 7\n",
      "hist_brand_first_or_price ----------------------------------- 6\n",
      "hist_brand_promt_attr --------------------------------------- 6\n",
      "hist_brand_dc_prom_10 --------------------------------------- 6\n",
      "hist_brand_quantity ----------------------------------------- 6\n",
      "hist_brand_dc_prom_times ------------------------------------ 6\n",
      "now_date_dc_third_values_rate ------------------------------- 6\n",
      "lastmonth_promt_dc_sku_or_price ----------------------------- 6\n",
      "lastmonth_promt_sku_or_price -------------------------------- 6\n",
      "qi_dc_third ------------------------------------------------- 6\n",
      "lastmonth_brand_promt_dc_quantity --------------------------- 6\n",
      "now_date_promt_third_attr ----------------------------------- 6\n",
      "hist_sku_prom_times ----------------------------------------- 6\n",
      "lastmonth_promt_dc_second_or_price -------------------------- 6\n",
      "now_date_promt_third_values_rate ---------------------------- 6\n",
      "now_date_promt_values_rate ---------------------------------- 6\n",
      "hist_promt_dc_third_vend ------------------------------------ 6\n",
      "lastmonth_brand_promt_dc_first_quantity --------------------- 6\n",
      "lastmonth_brand_dc_third_vend ------------------------------- 6\n",
      "now_date_promt_dc_first_values_rate ------------------------- 6\n",
      "lastmonth_brand_dc_third_discount --------------------------- 6\n",
      "hist_brand_promt_second_or_price ---------------------------- 6\n",
      "hist_dc_sku_discount ---------------------------------------- 6\n",
      "lastmonth_promt_dc_third_attr ------------------------------- 6\n",
      "hist_brand_dc_or_price -------------------------------------- 6\n",
      "now_date_dc_third_prom_times -------------------------------- 6\n",
      "now_brand_dc_third_prom_10 ---------------------------------- 6\n",
      "now_date_second_attr ---------------------------------------- 6\n",
      "now_date_promt_dc_second_values_rate ------------------------ 6\n",
      "qi_brand_promt ---------------------------------------------- 6\n",
      "now_brand_dc_third_prom_times ------------------------------- 6\n",
      "hist_dc_second_prom_4 --------------------------------------- 6\n",
      "hist_brand_dc_prom_ok --------------------------------------- 6\n",
      "lastmonth_brand_second_prom_10 ------------------------------ 6\n",
      "lastmonth_brand_third_prom_1 -------------------------------- 6\n",
      "now_date_sku_prom_1 ----------------------------------------- 6\n",
      "lastmonth_dc_sku_prom_ok ------------------------------------ 6\n",
      "now_brand_third_attr_values --------------------------------- 6\n",
      "hist_brand_dc_prom_6 ---------------------------------------- 6\n",
      "now_dc_third_prom_times ------------------------------------- 6\n",
      "lastmonth_promt_dc_second_discount -------------------------- 6\n",
      "hist_brand_dc_values_rate ----------------------------------- 6\n",
      "hist_brand_promt_second_attr_values ------------------------- 6\n",
      "lastmonth_dc_sku_prom_10 ------------------------------------ 6\n",
      "lastmonth_brand_third_or_price ------------------------------ 6\n",
      "lastmonth_brand_dc_discount --------------------------------- 6\n",
      "now_date_promt_second_attr ---------------------------------- 6\n",
      "hist_brand_promt_first_or_price ----------------------------- 6\n",
      "hist_brand_dc_first_prom_6 ---------------------------------- 6\n",
      "hist_brand_first_prom_10 ------------------------------------ 6\n",
      "hist_brand_dc_second_vend ----------------------------------- 6\n",
      "hist_promt_dc_sku_vend -------------------------------------- 6\n",
      "lastmonth_brand_second_or_price ----------------------------- 5\n",
      "now_date_third_attr ----------------------------------------- 5\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "now_brand_dc_third_prom_ok ---------------------------------- 5\n",
      "hist_third_prom_1 ------------------------------------------- 5\n",
      "hist_brand_second_prom_ok ----------------------------------- 5\n",
      "now_date_brand_third_attr_values ---------------------------- 5\n",
      "hist_brand_promt_third_vend --------------------------------- 5\n",
      "hist_promt_dc_third_attr ------------------------------------ 5\n",
      "lastmonth_third_discount ------------------------------------ 5\n",
      "lastmonth_brand_prom_times ---------------------------------- 5\n",
      "hist_brand_prom_4 ------------------------------------------- 5\n",
      "lastmonth_dc_sku_prom_times --------------------------------- 5\n",
      "lastmonth_promt_dc_third_vend ------------------------------- 5\n",
      "hist_brand_second_or_price ---------------------------------- 5\n",
      "hist_brand_dc_discount -------------------------------------- 5\n",
      "lastmonth_third_prom_1 -------------------------------------- 5\n",
      "lastmonth_brand_prom_1 -------------------------------------- 5\n",
      "lastmonth_brand_promt_sku_discount -------------------------- 5\n",
      "now_brand_prom_times ---------------------------------------- 5\n",
      "hist_brand_promt_vend --------------------------------------- 5\n",
      "qi_lastmonth_brand_promt_dc --------------------------------- 5\n",
      "now_sku_prom_ok --------------------------------------------- 5\n",
      "hist_brand_second_prom_6 ------------------------------------ 5\n",
      "hist_brand_second_prom_4 ------------------------------------ 5\n",
      "lastmonth_brand_sku_prom_1 ---------------------------------- 5\n",
      "now_date_brand_prom_ok -------------------------------------- 5\n",
      "lastmonth_brand_dc_third_prom_times ------------------------- 5\n",
      "lastmonth_sku_prom_10 --------------------------------------- 5\n",
      "hist_brand_promt_attr_values -------------------------------- 5\n",
      "hist_brand_promt_dc_attr_values ----------------------------- 5\n",
      "lastmonth_brand_promt_third_quantity ------------------------ 5\n",
      "qi_lastmonth_brand_promt_dc_third --------------------------- 5\n",
      "lastmonth_brand_third_prom_ok ------------------------------- 5\n",
      "hist_brand_promt_dc_third_attr ------------------------------ 5\n",
      "now_date_brand_dc_prom_1 ------------------------------------ 5\n",
      "now_date_dc_third_prom_6 ------------------------------------ 5\n",
      "now_date_third_prom_10 -------------------------------------- 5\n",
      "now_date_third_prom_times ----------------------------------- 5\n",
      "hist_brand_promt_dc_third_attr_values ----------------------- 5\n",
      "now_date_brand_sku_prom_1 ----------------------------------- 5\n",
      "now_dc_sku_prom_ok ------------------------------------------ 5\n",
      "hist_dc_third_discount -------------------------------------- 5\n",
      "now_brand_sku_prom_6 ---------------------------------------- 5\n",
      "lastmonth_promt_dc_sku_discount ----------------------------- 5\n",
      "hist_brand_first_quantity ----------------------------------- 5\n",
      "lastmonth_brand_promt_dc_second_attr_values ----------------- 5\n",
      "now_brand_dc_sku_prom_1 ------------------------------------- 5\n",
      "qi_lastmonth_promt_second ----------------------------------- 5\n",
      "lastmonth_dc_second_values_rate ----------------------------- 5\n",
      "now_date_promt_dc_second_attr ------------------------------- 5\n",
      "lastmonth_brand_dc_sku_vend --------------------------------- 5\n",
      "lastmonth_promt_second_quantity ----------------------------- 5\n",
      "hist_brand_second_prom_10 ----------------------------------- 5\n",
      "now_date_second_values_rate --------------------------------- 5\n",
      "hist_brand_dc_sku_or_price ---------------------------------- 5\n",
      "lastmonth_brand_second_vend --------------------------------- 5\n",
      "lastmonth_promt_third_discount ------------------------------ 5\n",
      "hist_brand_promt_first_discount ----------------------------- 5\n",
      "now_date_promt_attr ----------------------------------------- 5\n",
      "qi_lastmonth_brand_dc_first --------------------------------- 5\n",
      "now_date_brand_dc_second_prom_1 ----------------------------- 5\n",
      "hist_brand_prom_10 ------------------------------------------ 5\n",
      "lastmonth_promt_dc_third_discount --------------------------- 5\n",
      "qi_brand_dc ------------------------------------------------- 5\n",
      "now_brand_dc_prom_1 ----------------------------------------- 5\n",
      "hist_promt_third_or_price ----------------------------------- 5\n",
      "hist_promt_dc_third_values_rate ----------------------------- 4\n",
      "lastmonth_brand_first_prom_times ---------------------------- 4\n",
      "hist_brand_promt_sku_vend ----------------------------------- 4\n",
      "qi_brand_first ---------------------------------------------- 4\n",
      "lastmonth_brand_promt_dc_third_or_price --------------------- 4\n",
      "hist_dc_sku_prom_1 ------------------------------------------ 4\n",
      "now_date_dc_third_attr -------------------------------------- 4\n",
      "now_promt_brand_dc_attr ------------------------------------- 4\n",
      "now_brand_second_attr_values -------------------------------- 4\n",
      "qi_lastmonth_promt_first ------------------------------------ 4\n",
      "now_date_dc_values_rate ------------------------------------- 4\n",
      "hist_brand_promt_first_vend --------------------------------- 4\n",
      "lastmonth_promt_dc_third_values_rate ------------------------ 4\n",
      "hist_brand_dc_third_vend ------------------------------------ 4\n",
      "hist_dc_third_prom_4 ---------------------------------------- 4\n",
      "hist_brand_prom_ok ------------------------------------------ 4\n",
      "hist_dc_third_attr ------------------------------------------ 4\n",
      "hist_brand_dc_sku_vend -------------------------------------- 4\n",
      "hist_brand_dc_sku_prom_10 ----------------------------------- 4\n",
      "lastmonth_brand_promt_second_discount ----------------------- 4\n",
      "lastmonth_brand_dc_or_price --------------------------------- 4\n",
      "lastmonth_brand_vend ---------------------------------------- 4\n",
      "now_date_first_values_rate ---------------------------------- 4\n",
      "now_date_promt_first_values_rate ---------------------------- 4\n",
      "lastmonth_brand_dc_sku_prom_times --------------------------- 4\n",
      "lastmonth_brand_promt_first_quantity ------------------------ 4\n",
      "lastmonth_brand_dc_second_prom_10 --------------------------- 4\n",
      "now_date_prom_ok -------------------------------------------- 4\n",
      "qi_lastmonth_brand_promt_second ----------------------------- 4\n",
      "lastmonth_promt_dc_second_attr ------------------------------ 4\n",
      "hist_dc_sku_prom_10 ----------------------------------------- 4\n",
      "lastmonth_brand_promt_sku_vend ------------------------------ 4\n",
      "qi_lastmonth_brand_promt_dc_first --------------------------- 4\n",
      "now_date_sku_prom_ok ---------------------------------------- 4\n",
      "lastmonth_brand_prom_6 -------------------------------------- 4\n",
      "now_brand_dc_third_prom_1 ----------------------------------- 4\n",
      "hist_promt_dc_second_or_price ------------------------------- 4\n",
      "now_date_promt_second_attr_values --------------------------- 4\n",
      "lastmonth_brand_promt_dc_third_attr_values ------------------ 4\n",
      "now_sku_prom_6 ---------------------------------------------- 4\n",
      "lastmonth_brand_dc_sku_prom_10 ------------------------------ 4\n",
      "lastmonth_brand_promt_dc_attr ------------------------------- 4\n",
      "hist_brand_third_prom_4 ------------------------------------- 4\n",
      "hist_brand_dc_second_or_price ------------------------------- 4\n",
      "lastmonth_brand_dc_sku_or_price ----------------------------- 4\n",
      "lastmonth_promt_second_or_price ----------------------------- 4\n",
      "lastmonth_dc_third_discount --------------------------------- 4\n",
      "lastmonth_brand_third_vend ---------------------------------- 4\n",
      "hist_brand_dc_prom_1 ---------------------------------------- 4\n",
      "now_date_promt_dc_third_values_rate ------------------------- 4\n",
      "lastmonth_brand_promt_or_price ------------------------------ 4\n",
      "now_date_second_prom_ok ------------------------------------- 4\n",
      "lastmonth_dc_sku_vend --------------------------------------- 4\n",
      "qi_promt_second --------------------------------------------- 4\n",
      "hist_dc_third_prom_ok --------------------------------------- 4\n",
      "qi_brand_promt_first ---------------------------------------- 4\n",
      "now_date_dc_first_prom_10 ----------------------------------- 4\n",
      "lastmonth_promt_dc_first_discount --------------------------- 4\n",
      "now_brand_sku_prom_ok --------------------------------------- 4\n",
      "hist_brand_sku_prom_4 --------------------------------------- 4\n",
      "now_date_brand_second_prom_1 -------------------------------- 4\n",
      "lastmonth_brand_dc_first_prom_10 ---------------------------- 4\n",
      "lastmonth_dc_third_vend ------------------------------------- 4\n",
      "now_date_dc_prom_ok ----------------------------------------- 4\n",
      "hist_brand_dc_first_prom_1 ---------------------------------- 4\n",
      "hist_promt_dc_sku_discount ---------------------------------- 4\n",
      "hist_brand_promt_second_discount ---------------------------- 4\n",
      "now_third_prom_ok ------------------------------------------- 3\n",
      "lastmonth_dc_third_prom_6 ----------------------------------- 3\n",
      "hist_dc_third_prom_10 --------------------------------------- 3\n",
      "hist_promt_dc_first_or_price -------------------------------- 3\n",
      "now_date_promt_attr_values ---------------------------------- 3\n",
      "hist_brand_promt_dc_first_vend ------------------------------ 3\n",
      "now_third_prom_10 ------------------------------------------- 3\n",
      "lastmonth_brand_second_prom_times --------------------------- 3\n",
      "lastmonth_promt_third_or_price ------------------------------ 3\n",
      "now_date_brand_dc_first_prom_1 ------------------------------ 3\n",
      "now_date_promt_brand_second_attr ---------------------------- 3\n",
      "hist_brand_first_vend --------------------------------------- 3\n",
      "now_promt_dc_first_attr_values ------------------------------ 3\n",
      "lastmonth_brand_promt_first_discount ------------------------ 3\n",
      "lastmonth_brand_first_or_price ------------------------------ 3\n",
      "hist_brand_dc_third_prom_10 --------------------------------- 3\n",
      "now_date_dc_prom_4 ------------------------------------------ 3\n",
      "lastmonth_brand_promt_third_discount ------------------------ 3\n",
      "hist_brand_promt_third_values_rate -------------------------- 3\n",
      "hist_dc_first_quantity -------------------------------------- 3\n",
      "qi_lastmonth_dc_second -------------------------------------- 3\n",
      "hist_promt_dc_second_attr ----------------------------------- 3\n",
      "lastmonth_sku_prom_1 ---------------------------------------- 3\n",
      "hist_brand_prom_6 ------------------------------------------- 3\n",
      "lastmonth_brand_dc_first_discount --------------------------- 3\n",
      "lastmonth_brand_promt_third_vend ---------------------------- 3\n",
      "lastmonth_brand_third_prom_times ---------------------------- 3\n",
      "now_date_dc_first_prom_times -------------------------------- 3\n",
      "now_date_second_prom_6 -------------------------------------- 3\n",
      "hist_brand_promt_dc_attr ------------------------------------ 3\n",
      "now_third_prom_6 -------------------------------------------- 3\n",
      "now_brand_first_prom_6 -------------------------------------- 3\n",
      "lastmonth_brand_promt_dc_sku_or_price ----------------------- 3\n",
      "hist_third_values_rate -------------------------------------- 3\n",
      "now_date_second_prom_10 ------------------------------------- 3\n",
      "hist_brand_dc_sku_prom_4 ------------------------------------ 3\n",
      "hist_brand_dc_sku_prom_6 ------------------------------------ 3\n",
      "lastmonth_brand_dc_quantity --------------------------------- 3\n",
      "hist_brand_promt_third_attr --------------------------------- 3\n",
      "hist_dc_second_quantity ------------------------------------- 3\n",
      "qi_dc ------------------------------------------------------- 3\n",
      "now_brand_third_prom_times ---------------------------------- 3\n",
      "hist_brand_promt_sku_attr_values ---------------------------- 3\n",
      "hist_brand_promt_dc_sku_vend -------------------------------- 3\n",
      "lastmonth_brand_dc_prom_times ------------------------------- 3\n",
      "lastmonth_brand_promt_first_or_price ------------------------ 3\n",
      "hist_brand_promt_dc_first_quantity -------------------------- 3\n",
      "now_date_dc_first_attr_values ------------------------------- 3\n",
      "now_brand_third_prom_10 ------------------------------------- 3\n",
      "hist_brand_third_prom_10 ------------------------------------ 3\n",
      "lastmonth_third_or_price ------------------------------------ 3\n",
      "now_brand_dc_sku_prom_10 ------------------------------------ 3\n",
      "hist_dc_values_rate ----------------------------------------- 3\n",
      "now_promt_third_attr ---------------------------------------- 3\n",
      "now_date_brand_prom_1 --------------------------------------- 3\n",
      "lastmonth_brand_promt_third_attr_values --------------------- 3\n",
      "now_brand_third_prom_ok ------------------------------------- 3\n",
      "qi_lastmonth_dc_first --------------------------------------- 3\n",
      "now_brand_second_prom_times --------------------------------- 3\n",
      "lastmonth_promt_dc_attr ------------------------------------- 3\n",
      "now_sku_prom_times ------------------------------------------ 3\n",
      "hist_brand_dc_third_prom_ok --------------------------------- 3\n",
      "now_date_brand_first_prom_1 --------------------------------- 3\n",
      "lastmonth_dc_prom_4 ----------------------------------------- 3\n",
      "lastmonth_dc_third_prom_ok ---------------------------------- 3\n",
      "hist_brand_dc_first_values_rate ----------------------------- 3\n",
      "lastmonth_brand_promt_vend ---------------------------------- 3\n",
      "lastmonth_brand_promt_second_attr_values -------------------- 3\n",
      "hist_promt_dc_second_quantity ------------------------------- 3\n",
      "hist_brand_dc_prom_4 ---------------------------------------- 3\n",
      "hist_brand_dc_first_vend ------------------------------------ 3\n",
      "hist_brand_dc_second_prom_1 --------------------------------- 3\n",
      "lastmonth_brand_promt_third_or_price ------------------------ 3\n",
      "lastmonth_sku_prom_ok --------------------------------------- 3\n",
      "hist_promt_dc_first_attr ------------------------------------ 3\n",
      "lastmonth_brand_prom_ok ------------------------------------- 3\n",
      "hist_brand_promt_first_attr_values -------------------------- 3\n",
      "lastmonth_brand_dc_first_vend ------------------------------- 3\n",
      "hist_brand_first_discount ----------------------------------- 3\n",
      "lastmonth_brand_dc_third_attr_values ------------------------ 3\n",
      "lastmonth_brand_promt_dc_first_attr ------------------------- 3\n",
      "lastmonth_brand_promt_dc_sku_vend --------------------------- 3\n",
      "now_promt_dc_second_attr ------------------------------------ 3\n",
      "now_brand_sku_prom_times ------------------------------------ 3\n",
      "now_date_first_prom_10 -------------------------------------- 3\n",
      "lastmonth_brand_promt_discount ------------------------------ 3\n",
      "hist_brand_dc_first_prom_ok --------------------------------- 3\n",
      "lastmonth_promt_dc_second_values_rate ----------------------- 3\n",
      "hist_brand_dc_second_prom_10 -------------------------------- 3\n",
      "lastmonth_brand_promt_dc_vend ------------------------------- 3\n",
      "lastmonth_brand_promt_dc_third_vend ------------------------- 3\n",
      "hist_dc_second_prom_6 --------------------------------------- 3\n",
      "now_dc_third_prom_10 ---------------------------------------- 3\n",
      "lastmonth_brand_promt_second_vend --------------------------- 3\n",
      "now_brand_dc_prom_10 ---------------------------------------- 3\n",
      "now_brand_prom_6 -------------------------------------------- 3\n",
      "hist_promt_attr_values -------------------------------------- 2\n",
      "now_date_promt_first_attr ----------------------------------- 2\n",
      "now_dc_sku_prom_times --------------------------------------- 2\n",
      "now_date_brand_values_rate ---------------------------------- 2\n",
      "hist_brand_dc_first_or_price -------------------------------- 2\n",
      "hist_sku_vend ----------------------------------------------- 2\n",
      "lastmonth_promt_dc_values_rate ------------------------------ 2\n",
      "hist_brand_promt_second_attr -------------------------------- 2\n",
      "hist_brand_promt_dc_second_or_price ------------------------- 2\n",
      "lastmonth_brand_dc_third_values_rate ------------------------ 2\n",
      "hist_brand_promt_dc_first_attr_values ----------------------- 2\n",
      "lastmonth_dc_sku_prom_6 ------------------------------------- 2\n",
      "hist_brand_dc_sku_discount ---------------------------------- 2\n",
      "lastmonth_promt_second_values_rate -------------------------- 2\n",
      "hist_brand_dc_first_attr ------------------------------------ 2\n",
      "qi_dc_second ------------------------------------------------ 2\n",
      "now_promt_brand_attr ---------------------------------------- 2\n",
      "now_date_brand_first_prom_ok -------------------------------- 2\n",
      "hist_brand_promt_dc_sku_discount ---------------------------- 2\n",
      "lastmonth_promt_first_discount ------------------------------ 2\n",
      "now_date_brand_dc_prom_ok ----------------------------------- 2\n",
      "hist_sku_or_price ------------------------------------------- 2\n",
      "hist_promt_third_values_rate -------------------------------- 2\n",
      "now_promt_dc_third_values_rate ------------------------------ 2\n",
      "hist_brand_promt_dc_second_attr ----------------------------- 2\n",
      "now_date_dc_first_values_rate ------------------------------- 2\n",
      "hist_brand_first_prom_times --------------------------------- 2\n",
      "now_dc_prom_4 ----------------------------------------------- 2\n",
      "now_brand_sku_prom_1 ---------------------------------------- 2\n",
      "qi_brand_dc_first ------------------------------------------- 2\n",
      "lastmonth_promt_dc_first_values_rate ------------------------ 2\n",
      "lastmonth_promt_first_attr_values --------------------------- 2\n",
      "now_brand_second_prom_6 ------------------------------------- 2\n",
      "now_brand_second_prom_1 ------------------------------------- 2\n",
      "hist_brand_dc_first_prom_times ------------------------------ 2\n",
      "now_date_brand_dc_third_prom_times -------------------------- 2\n",
      "lastmonth_promt_third_attr_values --------------------------- 2\n",
      "hist_brand_dc_first_prom_10 --------------------------------- 2\n",
      "lastmonth_brand_dc_prom_1 ----------------------------------- 2\n",
      "lastmonth_third_prom_ok ------------------------------------- 2\n",
      "hist_brand_promt_dc_third_or_price -------------------------- 2\n",
      "now_date_dc_second_prom_4 ----------------------------------- 2\n",
      "now_date_dc_second_prom_6 ----------------------------------- 2\n",
      "hist_brand_dc_sku_prom_1 ------------------------------------ 2\n",
      "lastmonth_brand_dc_second_prom_1 ---------------------------- 2\n",
      "hist_dc_prom_1 ---------------------------------------------- 2\n",
      "hist_promt_second_vend -------------------------------------- 2\n",
      "lastmonth_promt_dc_second_vend ------------------------------ 2\n",
      "now_date_brand_second_prom_10 ------------------------------- 2\n",
      "lastmonth_promt_first_or_price ------------------------------ 2\n",
      "now_date_brand_sku_prom_ok ---------------------------------- 2\n",
      "now_date_dc_prom_times -------------------------------------- 2\n",
      "hist_brand_first_prom_6 ------------------------------------- 2\n",
      "now_date_promt_dc_second_attr_values ------------------------ 2\n",
      "now_dc_second_prom_4 ---------------------------------------- 2\n",
      "lastmonth_brand_promt_dc_third_attr ------------------------- 2\n",
      "now_dc_second_attr ------------------------------------------ 2\n",
      "hist_second_values_rate ------------------------------------- 2\n",
      "hist_dc_third_vend ------------------------------------------ 2\n",
      "hist_brand_promt_dc_quantity -------------------------------- 2\n",
      "hist_promt_sku_values_rate ---------------------------------- 2\n",
      "qi_lastmonth_promt ------------------------------------------ 2\n",
      "hist_brand_vend --------------------------------------------- 2\n",
      "lastmonth_brand_dc_prom_ok ---------------------------------- 2\n",
      "hist_brand_sku_attr_values ---------------------------------- 2\n",
      "now_date_dc_third_prom_10 ----------------------------------- 2\n",
      "now_date_brand_dc_prom_times -------------------------------- 2\n",
      "hist_promt_second_values_rate ------------------------------- 2\n",
      "qi_brand_dc_third ------------------------------------------- 2\n",
      "now_date_promt_brand_attr ----------------------------------- 2\n",
      "hist_dc_sku_prom_ok ----------------------------------------- 2\n",
      "hist_promt_second_attr -------------------------------------- 2\n",
      "lastmonth_dc_third_prom_10 ---------------------------------- 2\n",
      "lastmonth_brand_dc_sku_prom_ok ------------------------------ 2\n",
      "now_dc_third_attr ------------------------------------------- 2\n",
      "hist_third_attr --------------------------------------------- 2\n",
      "now_brand_dc_second_prom_10 --------------------------------- 2\n",
      "now_brand_first_prom_ok ------------------------------------- 2\n",
      "now_brand_second_prom_10 ------------------------------------ 2\n",
      "now_date_dc_second_attr ------------------------------------- 2\n",
      "hist_third_prom_times --------------------------------------- 2\n",
      "lastmonth_promt_second_vend --------------------------------- 2\n",
      "now_date_dc_third_prom_1 ------------------------------------ 2\n",
      "hist_dc_sku_prom_4 ------------------------------------------ 2\n",
      "lastmonth_brand_dc_first_prom_ok ---------------------------- 2\n",
      "lastmonth_brand_second_prom_6 ------------------------------- 2\n",
      "lastmonth_brand_promt_dc_first_attr_values ------------------ 2\n",
      "now_date_third_prom_6 --------------------------------------- 2\n",
      "now_date_dc_first_prom_4 ------------------------------------ 2\n",
      "now_date_prom_4 --------------------------------------------- 2\n",
      "qi_third ---------------------------------------------------- 2\n",
      "lastmonth_brand_dc_sku_prom_1 ------------------------------- 2\n",
      "lastmonth_dc_second_prom_4 ---------------------------------- 2\n",
      "now_date_promt_brand_third_attr ----------------------------- 2\n",
      "lastmonth_promt_attr ---------------------------------------- 2\n",
      "hist_brand_dc_second_prom_4 --------------------------------- 2\n",
      "hist_brand_promt_dc_or_price -------------------------------- 2\n",
      "lastmonth_dc_third_prom_times ------------------------------- 2\n",
      "now_dc_second_prom_ok --------------------------------------- 2\n",
      "now_dc_third_prom_6 ----------------------------------------- 2\n",
      "hist_promt_first_attr_values -------------------------------- 2\n",
      "hist_dc_sku_attr -------------------------------------------- 2\n",
      "lastmonth_promt_second_discount ----------------------------- 2\n",
      "lastmonth_promt_third_vend ---------------------------------- 2\n",
      "lastmonth_promt_second_attr --------------------------------- 2\n",
      "hist_brand_second_attr -------------------------------------- 2\n",
      "now_promt_brand_dc_attr_values ------------------------------ 2\n",
      "attr_values ------------------------------------------------- 2\n",
      "now_date_promt_dc_attr_values ------------------------------- 2\n",
      "lastmonth_brand_promt_dc_third_values_rate ------------------ 2\n",
      "now_brand_prom_10 ------------------------------------------- 2\n",
      "now_third_prom_times ---------------------------------------- 2\n",
      "hist_brand_dc_third_attr_values ----------------------------- 2\n",
      "lastmonth_brand_dc_first_prom_1 ----------------------------- 2\n",
      "now_promt_dc_second_values_rate ----------------------------- 2\n",
      "hist_brand_promt_dc_third_vend ------------------------------ 2\n",
      "lastmonth_sku_prom_times ------------------------------------ 2\n",
      "hist_brand_dc_third_values_rate ----------------------------- 2\n",
      "hist_brand_dc_third_prom_4 ---------------------------------- 2\n",
      "lastmonth_brand_first_prom_1 -------------------------------- 2\n",
      "now_date_third_prom_4 --------------------------------------- 2\n",
      "now_date_third_prom_1 --------------------------------------- 2\n",
      "hist_promt_first_vend --------------------------------------- 2\n",
      "hist_promt_dc_first_discount -------------------------------- 2\n",
      "lastmonth_promt_dc_quantity --------------------------------- 2\n",
      "lastmonth_brand_promt_dc_second_attr ------------------------ 2\n",
      "lastmonth_dc_third_attr_values ------------------------------ 2\n",
      "hist_promt_or_price ----------------------------------------- 1\n",
      "hist_brand_promt_dc_second_attr_values ---------------------- 1\n",
      "now_date_promt_brand_first_values_rate ---------------------- 1\n",
      "lastmonth_dc_third_prom_4 ----------------------------------- 1\n",
      "hist_second_quantity ---------------------------------------- 1\n",
      "now_date_brand_prom_times ----------------------------------- 1\n",
      "hist_brand_promt_second_vend -------------------------------- 1\n",
      "now_dc_second_prom_1 ---------------------------------------- 1\n",
      "now_brand_dc_second_prom_4 ---------------------------------- 1\n",
      "now_brand_dc_second_prom_1 ---------------------------------- 1\n",
      "lastmonth_brand_promt_dc_first_vend ------------------------- 1\n",
      "lastmonth_brand_dc_vend ------------------------------------- 1\n",
      "now_dc_third_prom_1 ----------------------------------------- 1\n",
      "hist_brand_attr --------------------------------------------- 1\n",
      "hist_promt_third_attr_values -------------------------------- 1\n",
      "now_brand_first_prom_times ---------------------------------- 1\n",
      "hist_promt_dc_discount -------------------------------------- 1\n",
      "now_promt_brand_dc_first_values_rate ------------------------ 1\n",
      "hist_brand_promt_dc_first_or_price -------------------------- 1\n",
      "lastmonth_brand_promt_dc_sku_attr --------------------------- 1\n",
      "lastmonth_brand_promt_second_or_price ----------------------- 1\n",
      "hist_brand_promt_first_attr --------------------------------- 1\n",
      "hist_dc_sku_prom_6 ------------------------------------------ 1\n",
      "lastmonth_dc_third_attr ------------------------------------- 1\n",
      "lastmonth_promt_dc_second_attr_values ----------------------- 1\n",
      "hist_promt_dc_first_vend ------------------------------------ 1\n",
      "hist_brand_first_values_rate -------------------------------- 1\n",
      "lastmonth_brand_first_values_rate --------------------------- 1\n",
      "now_brand_dc_first_attr ------------------------------------- 1\n",
      "lastmonth_brand_promt_dc_sku_attr_values -------------------- 1\n",
      "hist_brand_values_rate -------------------------------------- 1\n",
      "hist_third_prom_10 ------------------------------------------ 1\n",
      "lastmonth_brand_promt_dc_sku_discount ----------------------- 1\n",
      "hist_brand_attr_values -------------------------------------- 1\n",
      "hist_brand_prom_1 ------------------------------------------- 1\n",
      "now_promt_dc_values_rate ------------------------------------ 1\n",
      "lastmonth_sku_prom_6 ---------------------------------------- 1\n",
      "qi_promt_first ---------------------------------------------- 1\n",
      "lastmonth_brand_promt_attr_values --------------------------- 1\n",
      "now_date_dc_first_attr -------------------------------------- 1\n",
      "lastmonth_promt_sku_attr_values ----------------------------- 1\n",
      "lastmonth_brand_dc_sku_values_rate -------------------------- 1\n",
      "values_rate ------------------------------------------------- 1\n",
      "hist_promt_second_attr_values ------------------------------- 1\n",
      "hist_brand_promt_dc_values_rate ----------------------------- 1\n",
      "hist_promt_dc_attr_values ----------------------------------- 1\n",
      "lastmonth_brand_dc_second_attr_values ----------------------- 1\n",
      "now_brand_second_prom_4 ------------------------------------- 1\n",
      "now_brand_dc_third_values_rate ------------------------------ 1\n",
      "lastmonth_dc_third_values_rate ------------------------------ 1\n",
      "hist_brand_dc_first_discount -------------------------------- 1\n",
      "now_promt_second_attr_values -------------------------------- 1\n",
      "now_third_prom_4 -------------------------------------------- 1\n",
      "now_third_prom_1 -------------------------------------------- 1\n",
      "lastmonth_brand_dc_first_prom_times ------------------------- 1\n",
      "now_promt_second_attr --------------------------------------- 1\n",
      "hist_brand_promt_values_rate -------------------------------- 1\n",
      "lastmonth_brand_dc_prom_4 ----------------------------------- 1\n",
      "lastmonth_brand_promt_dc_second_discount -------------------- 1\n",
      "lastmonth_third_prom_times ---------------------------------- 1\n",
      "hist_promt_first_discount ----------------------------------- 1\n",
      "lastmonth_brand_dc_second_prom_6 ---------------------------- 1\n",
      "now_promt_first_attr_values --------------------------------- 1\n",
      "now_date_dc_first_prom_ok ----------------------------------- 1\n",
      "lastmonth_second_prom_4 ------------------------------------- 1\n",
      "lastmonth_promt_sku_attr ------------------------------------ 1\n",
      "hist_brand_promt_dc_second_values_rate ---------------------- 1\n",
      "lastmonth_dc_second_discount -------------------------------- 1\n",
      "hist_promt_values_rate -------------------------------------- 1\n",
      "hist_brand_first_prom_1 ------------------------------------- 1\n",
      "now_date_brand_second_values_rate --------------------------- 1\n",
      "lastmonth_brand_promt_dc_discount --------------------------- 1\n",
      "now_promt_brand_dc_first_attr ------------------------------- 1\n",
      "now_third_attr ---------------------------------------------- 1\n",
      "hist_dc_first_prom_times ------------------------------------ 1\n",
      "now_brand_attr_values --------------------------------------- 1\n",
      "now_brand_dc_attr ------------------------------------------- 1\n",
      "hist_brand_dc_attr ------------------------------------------ 1\n",
      "lastmonth_promt_first_vend ---------------------------------- 1\n",
      "lastmonth_dc_sku_attr --------------------------------------- 1\n",
      "lastmonth_brand_first_attr ---------------------------------- 1\n",
      "hist_brand_promt_dc_vend ------------------------------------ 1\n",
      "hist_promt_first_or_price ----------------------------------- 1\n",
      "hist_dc_second_or_price ------------------------------------- 1\n",
      "now_date_brand_dc_third_prom_10 ----------------------------- 1\n",
      "lastmonth_brand_first_vend ---------------------------------- 1\n",
      "hist_brand_promt_first_values_rate -------------------------- 1\n",
      "now_date_first_prom_ok -------------------------------------- 1\n",
      "lastmonth_dc_first_prom_6 ----------------------------------- 1\n",
      "now_date_brand_dc_third_attr_values ------------------------- 1\n",
      "now_date_brand_dc_first_prom_times -------------------------- 1\n",
      "lastmonth_promt_second_attr_values -------------------------- 1\n",
      "hist_promt_dc_sku_attr_values ------------------------------- 1\n",
      "lastmonth_brand_promt_first_values_rate --------------------- 1\n",
      "now_date_brand_dc_values_rate ------------------------------- 1\n",
      "lastmonth_brand_promt_dc_first_or_price --------------------- 1\n",
      "hist_dc_third_prom_times ------------------------------------ 1\n",
      "lastmonth_brand_attr ---------------------------------------- 1\n",
      "now_dc_second_attr_values ----------------------------------- 1\n",
      "now_date_brand_first_prom_times ----------------------------- 1\n",
      "hist_promt_dc_second_vend ----------------------------------- 1\n",
      "hist_promt_second_or_price ---------------------------------- 1\n",
      "now_brand_dc_third_prom_6 ----------------------------------- 1\n",
      "now_brand_first_prom_10 ------------------------------------- 1\n",
      "now_promt_dc_first_attr ------------------------------------- 1\n",
      "now_dc_first_attr_values ------------------------------------ 1\n",
      "lastmonth_third_prom_4 -------------------------------------- 1\n",
      "now_brand_third_values_rate --------------------------------- 1\n",
      "qi_brand_dc_second ------------------------------------------ 1\n",
      "now_date_dc_attr -------------------------------------------- 1\n",
      "qi_dc_first ------------------------------------------------- 1\n",
      "qi_lastmonth_second ----------------------------------------- 1\n",
      "now_date_dc_second_prom_ok ---------------------------------- 1\n",
      "hist_brand_dc_first_prom_4 ---------------------------------- 1\n",
      "hist_brand_dc_sku_attr -------------------------------------- 1\n",
      "now_date_promt_third_attr_values ---------------------------- 1\n",
      "lastmonth_brand_third_prom_6 -------------------------------- 1\n",
      "lastmonth_brand_second_prom_1 ------------------------------- 1\n",
      "lastmonth_dc_first_quantity --------------------------------- 1\n",
      "hist_third_attr_values -------------------------------------- 1\n",
      "qi_second --------------------------------------------------- 1\n",
      "hist_sku_prom_6 --------------------------------------------- 1\n",
      "lastmonth_brand_dc_first_attr_values ------------------------ 1\n",
      "now_dc_third_attr_values ------------------------------------ 1\n",
      "now_dc_third_prom_ok ---------------------------------------- 1\n",
      "now_promt_dc_first_values_rate ------------------------------ 1\n",
      "hist_brand_dc_sku_attr_values ------------------------------- 1\n",
      "now_dc_first_prom_times ------------------------------------- 1\n",
      "hist_promt_dc_vend ------------------------------------------ 1\n",
      "lastmonth_dc_second_prom_times ------------------------------ 1\n",
      "lastmonth_brand_promt_dc_first_discount --------------------- 1\n",
      "hist_brand_dc_second_attr ----------------------------------- 1\n",
      "lastmonth_brand_promt_dc_third_discount --------------------- 1\n",
      "lastmonth_brand_dc_third_prom_ok ---------------------------- 1\n",
      "now_date_promt_dc_third_attr -------------------------------- 1\n",
      "hist_brand_dc_sku_prom_ok ----------------------------------- 1\n",
      "lastmonth_brand_second_prom_ok ------------------------------ 1\n",
      "lastmonth_brand_dc_sku_prom_4 ------------------------------- 1\n",
      "hist_brand_promt_dc_sku_or_price ---------------------------- 1\n",
      "now_date_brand_second_prom_times ---------------------------- 1\n",
      "now_date_brand_dc_second_prom_times ------------------------- 1\n",
      "hist_promt_dc_third_or_price -------------------------------- 1\n",
      "now_date_promt_brand_dc_first_attr -------------------------- 1\n",
      "hist_dc_second_attr ----------------------------------------- 1\n",
      "hist_brand_dc_second_attr_values ---------------------------- 1\n",
      "hist_third_vend --------------------------------------------- 1\n",
      "now_date_brand_second_attr_values --------------------------- 1\n",
      "now_date_promt_brand_third_attr_values ---------------------- 1\n",
      "hist_brand_promt_dc_second_discount ------------------------- 1\n",
      "hist_brand_promt_dc_sku_attr_values ------------------------- 1\n",
      "hist_dc_second_prom_10 -------------------------------------- 1\n",
      "now_dc_second_values_rate ----------------------------------- 1\n",
      "qi_lastmonth_brand_promt_dc_second -------------------------- 1\n",
      "lastmonth_brand_attr_values --------------------------------- 1\n",
      "lastmonth_brand_third_attr ---------------------------------- 1\n",
      "now_brand_dc_third_attr_values ------------------------------ 1\n",
      "hist_brand_dc_second_prom_ok -------------------------------- 1\n",
      "hist_dc_second_vend ----------------------------------------- 1\n",
      "now_brand_dc_first_prom_times ------------------------------- 1\n",
      "now_brand_third_prom_4 -------------------------------------- 1\n",
      "now_promt_dc_third_attr ------------------------------------- 1\n",
      "hist_brand_sku_values_rate ---------------------------------- 1\n",
      "hist_brand_promt_dc_sku_values_rate ------------------------- 1\n",
      "now_date_dc_third_attr_values ------------------------------- 1\n",
      "now_promt_dc_second_attr_values ----------------------------- 1\n",
      "lastmonth_brand_or_price ------------------------------------ 1\n",
      "lastmonth_promt_dc_attr_values ------------------------------ 1\n",
      "hist_promt_dc_sku_values_rate ------------------------------- 1\n",
      "lastmonth_promt_dc_first_attr ------------------------------- 1\n",
      "now_brand_dc_prom_ok ---------------------------------------- 1\n",
      "now_date_promt_brand_values_rate ---------------------------- 1\n",
      "now_promt_brand_dc_values_rate ------------------------------ 1\n",
      "now_date_promt_brand_dc_third_attr_values ------------------- 1\n",
      "hist_dc_second_prom_1 --------------------------------------- 1\n",
      "hist_brand_promt_sku_or_price ------------------------------- 1\n",
      "lastmonth_promt_third_attr ---------------------------------- 1\n",
      "hist_dc_second_discount ------------------------------------- 1\n",
      "hist_brand_dc_second_values_rate ---------------------------- 1\n",
      "now_brand_dc_prom_6 ----------------------------------------- 1\n",
      "hist_promt_dc_or_price -------------------------------------- 1\n",
      "lastmonth_brand_first_prom_4 -------------------------------- 1\n",
      "lastmonth_brand_promt_first_attr ---------------------------- 1\n",
      "now_date_promt_brand_dc_attr_values ------------------------- 1\n"
     ]
    }
   ],
   "source": [
    "qq=model.get_fscore()\n",
    "a=sorted(qq,key=lambda x:qq[x],reverse=True)\n",
    "print len(a)\n",
    "for i in a:\n",
    "    print i,'-'*(60-len(i)),qq[i]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_X=test\n",
    "#test_Y=train2['quantity']\n",
    "\n",
    "\n",
    "test_xgb=xgb.DMatrix(test_X)\n",
    "test_pred=model.predict(test_xgb)\n",
    "print test_pred.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "print test_pred\n",
    "intest=pd.read_csv('test.csv')\n",
    "intest.drop(test.columns[[0]], axis=1,inplace=True)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "u=pd.DataFrame()\n",
    "cc=intest\n",
    "u['date']=cc.date\n",
    "u['dc_id']=cc.dc_id\n",
    "u['item_sku_id']=cc.sku_id\n",
    "u['quantity']=pd.Series(test_pred)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "u['date']=u.date.map(lambda x:int(x.split('-')[2]))\n",
    "u['quantity']=u.quantity.map(lambda x: float('%.2f' % float(x)))\n",
    "print u\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "u.to_csv('v3_qi_month_R1000_bigstep.csv',index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "450\n",
      "qi_sku ------------------------------------------------------ 506\n",
      "qi_dc_sku --------------------------------------------------- 476\n",
      "hist_dc_sku_quantity ---------------------------------------- 328\n",
      "hist_brand_sku_quantity ------------------------------------- 285\n",
      "hist_brand_dc_sku_quantity ---------------------------------- 188\n",
      "hist_sku_quantity ------------------------------------------- 156\n",
      "qi_brand ---------------------------------------------------- 82\n",
      "qi_brand_dc ------------------------------------------------- 51\n",
      "hist_brand_sku_discount ------------------------------------- 50\n",
      "now_date_sku_prom_1 ----------------------------------------- 47\n",
      "hist_brand_sku_prom_1 --------------------------------------- 46\n",
      "hist_brand_dc_third_quantity -------------------------------- 42\n",
      "hist_brand_third_quantity ----------------------------------- 42\n",
      "hist_brand_quantity ----------------------------------------- 41\n",
      "now_date_values_rate ---------------------------------------- 39\n",
      "now_date_first_prom_6 --------------------------------------- 38\n",
      "now_date_attr ----------------------------------------------- 37\n",
      "now_brand_sku_prom_ok --------------------------------------- 36\n",
      "qi_brand_dc_first ------------------------------------------- 35\n",
      "hist_brand_sku_vend ----------------------------------------- 35\n",
      "qi_brand_first ---------------------------------------------- 34\n",
      "now_date_dc_prom_1 ------------------------------------------ 33\n",
      "qi_dc_second ------------------------------------------------ 29\n",
      "qi_brand_second --------------------------------------------- 28\n",
      "hist_brand_prom_6 ------------------------------------------- 28\n",
      "now_third_prom_1 -------------------------------------------- 26\n",
      "now_brand_sku_prom_1 ---------------------------------------- 26\n",
      "hist_sku_vend ----------------------------------------------- 25\n",
      "hist_dc_third_prom_10 --------------------------------------- 25\n",
      "hist_brand_sku_prom_10 -------------------------------------- 25\n",
      "now_date_sku_prom_ok ---------------------------------------- 25\n",
      "hist_brand_sku_or_price ------------------------------------- 25\n",
      "hist_sku_discount ------------------------------------------- 24\n",
      "hist_brand_dc_discount -------------------------------------- 24\n",
      "hist_brand_third_prom_times --------------------------------- 24\n",
      "hist_brand_second_quantity ---------------------------------- 24\n",
      "hist_brand_sku_prom_times ----------------------------------- 24\n",
      "now_date_prom_6 --------------------------------------------- 23\n",
      "hist_dc_third_or_price -------------------------------------- 22\n",
      "hist_brand_dc_quantity -------------------------------------- 22\n",
      "qi_dc_third ------------------------------------------------- 22\n",
      "hist_brand_first_quantity ----------------------------------- 22\n",
      "now_date_dc_first_prom_1 ------------------------------------ 21\n",
      "hist_brand_second_prom_times -------------------------------- 21\n",
      "hist_brand_dc_third_discount -------------------------------- 21\n",
      "now_date_third_prom_10 -------------------------------------- 20\n",
      "now_date_second_prom_1 -------------------------------------- 20\n",
      "hist_brand_dc_second_quantity ------------------------------- 20\n",
      "hist_dc_third_quantity -------------------------------------- 20\n",
      "hist_dc_sku_prom_1 ------------------------------------------ 19\n",
      "now_date_first_prom_1 --------------------------------------- 19\n",
      "now_date_prom_10 -------------------------------------------- 19\n",
      "now_brand_sku_prom_times ------------------------------------ 19\n",
      "now_date_prom_1 --------------------------------------------- 19\n",
      "hist_brand_second_discount ---------------------------------- 18\n",
      "now_date_dc_second_prom_times ------------------------------- 18\n",
      "hist_dc_sku_prom_times -------------------------------------- 18\n",
      "hist_sku_prom_1 --------------------------------------------- 18\n",
      "now_dc_third_prom_1 ----------------------------------------- 18\n",
      "hist_dc_second_values_rate ---------------------------------- 18\n",
      "hist_dc_third_prom_ok --------------------------------------- 18\n",
      "hist_brand_sku_prom_ok -------------------------------------- 17\n",
      "hist_brand_dc_or_price -------------------------------------- 17\n",
      "now_brand_date_sku_prom_1 ----------------------------------- 17\n",
      "hist_brand_dc_third_prom_1 ---------------------------------- 17\n",
      "now_dc_sku_prom_1 ------------------------------------------- 16\n",
      "hist_third_prom_1 ------------------------------------------- 16\n",
      "hist_third_prom_4 ------------------------------------------- 16\n",
      "now_date_dc_second_values_rate ------------------------------ 16\n",
      "hist_brand_dc_third_or_price -------------------------------- 16\n",
      "hist_brand_third_prom_ok ------------------------------------ 16\n",
      "hist_dc_sku_vend -------------------------------------------- 16\n",
      "now_sku_prom_1 ---------------------------------------------- 16\n",
      "now_date_third_prom_times ----------------------------------- 16\n",
      "hist_sku_or_price ------------------------------------------- 15\n",
      "now_dc_sku_prom_ok ------------------------------------------ 15\n",
      "hist_brand_sku_prom_6 --------------------------------------- 15\n",
      "hist_brand_prom_10 ------------------------------------------ 15\n",
      "hist_sku_prom_10 -------------------------------------------- 14\n",
      "now_brand_date_sku_prom_ok ---------------------------------- 14\n",
      "now_date_dc_second_prom_1 ----------------------------------- 14\n",
      "hist_brand_dc_first_quantity -------------------------------- 14\n",
      "hist_third_vend --------------------------------------------- 14\n",
      "hist_brand_dc_second_prom_6 --------------------------------- 14\n",
      "hist_sku_prom_times ----------------------------------------- 13\n",
      "hist_brand_sku_prom_4 --------------------------------------- 13\n",
      "hist_dc_sku_discount ---------------------------------------- 13\n",
      "now_sku_prom_ok --------------------------------------------- 13\n",
      "hist_dc_sku_or_price ---------------------------------------- 13\n",
      "hist_dc_third_values_rate ----------------------------------- 13\n",
      "hist_brand_second_prom_ok ----------------------------------- 12\n",
      "hist_brand_dc_third_prom_10 --------------------------------- 12\n",
      "hist_brand_second_prom_1 ------------------------------------ 12\n",
      "hist_third_discount ----------------------------------------- 12\n",
      "hist_dc_third_discount -------------------------------------- 12\n",
      "hist_brand_dc_second_prom_1 --------------------------------- 12\n",
      "now_date_third_prom_1 --------------------------------------- 12\n",
      "hist_brand_dc_second_prom_ok -------------------------------- 11\n",
      "hist_brand_prom_1 ------------------------------------------- 11\n",
      "hist_brand_third_vend --------------------------------------- 11\n",
      "hist_brand_second_prom_6 ------------------------------------ 11\n",
      "now_brand_first_prom_ok ------------------------------------- 11\n",
      "now_sku_prom_times ------------------------------------------ 11\n",
      "hist_dc_first_prom_1 ---------------------------------------- 11\n",
      "hist_brand_third_prom_6 ------------------------------------- 11\n",
      "hist_brand_third_prom_4 ------------------------------------- 11\n",
      "hist_brand_dc_prom_6 ---------------------------------------- 11\n",
      "now_brand_dc_sku_prom_1 ------------------------------------- 11\n",
      "now_brand_third_prom_1 -------------------------------------- 11\n",
      "hist_brand_dc_prom_10 --------------------------------------- 10\n",
      "now_date_dc_prom_6 ------------------------------------------ 10\n",
      "hist_brand_dc_third_prom_times ------------------------------ 10\n",
      "now_date_dc_first_prom_times -------------------------------- 10\n",
      "now_brand_second_prom_1 ------------------------------------- 10\n",
      "hist_dc_third_vend ------------------------------------------ 10\n",
      "now_date_first_prom_times ----------------------------------- 10\n",
      "now_date_dc_second_prom_10 ---------------------------------- 10\n",
      "qi_dc_first ------------------------------------------------- 10\n",
      "hist_sku_prom_ok -------------------------------------------- 10\n",
      "hist_brand_dc_prom_1 ---------------------------------------- 10\n",
      "hist_brand_discount ----------------------------------------- 10\n",
      "now_brand_prom_10 ------------------------------------------- 10\n",
      "hist_brand_dc_second_prom_times ----------------------------- 10\n",
      "now_date_dc_attr_values ------------------------------------- 9\n",
      "now_date_second_attr_values --------------------------------- 9\n",
      "now_date_dc_prom_10 ----------------------------------------- 9\n",
      "hist_brand_dc_second_or_price ------------------------------- 9\n",
      "now_date_first_attr ----------------------------------------- 9\n",
      "hist_brand_dc_first_prom_times ------------------------------ 9\n",
      "now_third_prom_6 -------------------------------------------- 9\n",
      "hist_brand_first_prom_6 ------------------------------------- 9\n",
      "now_date_dc_third_prom_times -------------------------------- 9\n",
      "now_date_dc_attr -------------------------------------------- 9\n",
      "hist_third_quantity ----------------------------------------- 9\n",
      "hist_brand_third_discount ----------------------------------- 9\n",
      "hist_third_prom_times --------------------------------------- 9\n",
      "now_date_dc_first_prom_6 ------------------------------------ 9\n",
      "hist_brand_dc_prom_4 ---------------------------------------- 9\n",
      "hist_brand_second_prom_10 ----------------------------------- 9\n",
      "hist_brand_dc_second_prom_10 -------------------------------- 9\n",
      "hist_dc_sku_prom_ok ----------------------------------------- 9\n",
      "now_third_prom_times ---------------------------------------- 9\n",
      "now_brand_first_prom_times ---------------------------------- 8\n",
      "hist_brand_third_or_price ----------------------------------- 8\n",
      "now_date_dc_values_rate ------------------------------------- 8\n",
      "now_brand_date_first_prom_1 --------------------------------- 8\n",
      "values_rate ------------------------------------------------- 8\n",
      "hist_brand_dc_first_discount -------------------------------- 8\n",
      "hist_brand_dc_sku_prom_times -------------------------------- 8\n",
      "now_brand_sku_prom_10 --------------------------------------- 8\n",
      "now_brand_prom_times ---------------------------------------- 8\n",
      "hist_dc_third_prom_6 ---------------------------------------- 8\n",
      "hist_dc_second_quantity ------------------------------------- 8\n",
      "qi_dc ------------------------------------------------------- 8\n",
      "hist_brand_vend --------------------------------------------- 8\n",
      "hist_dc_sku_prom_10 ----------------------------------------- 8\n",
      "now_date_dc_third_prom_10 ----------------------------------- 8\n",
      "hist_dc_third_prom_times ------------------------------------ 8\n",
      "now_brand_third_prom_10 ------------------------------------- 8\n",
      "now_sku_prom_10 --------------------------------------------- 8\n",
      "now_brand_third_prom_ok ------------------------------------- 8\n",
      "hist_brand_third_prom_1 ------------------------------------- 8\n",
      "hist_brand_prom_times --------------------------------------- 8\n",
      "hist_brand_dc_sku_or_price ---------------------------------- 8\n",
      "now_dc_third_prom_10 ---------------------------------------- 8\n",
      "hist_brand_dc_second_vend ----------------------------------- 8\n",
      "now_dc_third_values_rate ------------------------------------ 7\n",
      "now_third_prom_10 ------------------------------------------- 7\n",
      "now_date_dc_third_values_rate ------------------------------- 7\n",
      "now_brand_date_values_rate ---------------------------------- 7\n",
      "hist_brand_first_vend --------------------------------------- 7\n",
      "now_brand_date_second_prom_1 -------------------------------- 7\n",
      "hist_brand_second_vend -------------------------------------- 7\n",
      "hist_brand_dc_third_vend ------------------------------------ 7\n",
      "hist_dc_third_prom_4 ---------------------------------------- 7\n",
      "hist_dc_third_prom_1 ---------------------------------------- 7\n",
      "hist_dc_third_attr ------------------------------------------ 7\n",
      "now_brand_date_second_prom_10 ------------------------------- 7\n",
      "hist_brand_dc_second_discount ------------------------------- 7\n",
      "now_date_prom_ok -------------------------------------------- 7\n",
      "now_brand_second_prom_10 ------------------------------------ 7\n",
      "now_third_attr_values --------------------------------------- 7\n",
      "hist_sku_prom_6 --------------------------------------------- 7\n",
      "now_dc_third_prom_6 ----------------------------------------- 7\n",
      "now_date_dc_second_attr_values ------------------------------ 7\n",
      "now_brand_dc_prom_1 ----------------------------------------- 7\n",
      "now_brand_prom_1 -------------------------------------------- 7\n",
      "now_dc_second_prom_4 ---------------------------------------- 6\n",
      "hist_brand_dc_prom_times ------------------------------------ 6\n",
      "now_date_second_prom_times ---------------------------------- 6\n",
      "now_date_dc_first_values_rate ------------------------------- 6\n",
      "hist_brand_first_prom_times --------------------------------- 6\n",
      "now_date_second_prom_10 ------------------------------------- 6\n",
      "now_date_dc_prom_times -------------------------------------- 6\n",
      "hist_brand_first_prom_1 ------------------------------------- 6\n",
      "now_brand_dc_third_prom_6 ----------------------------------- 6\n",
      "hist_brand_dc_vend ------------------------------------------ 6\n",
      "now_date_dc_second_attr ------------------------------------- 6\n",
      "now_date_dc_third_prom_1 ------------------------------------ 6\n",
      "now_brand_dc_prom_times ------------------------------------- 6\n",
      "hist_dc_second_prom_4 --------------------------------------- 6\n",
      "hist_brand_or_price ----------------------------------------- 6\n",
      "now_brand_dc_first_prom_1 ----------------------------------- 6\n",
      "hist_sku_prom_4 --------------------------------------------- 6\n",
      "now_dc_third_prom_times ------------------------------------- 6\n",
      "hist_brand_dc_third_values_rate ----------------------------- 6\n",
      "now_date_prom_times ----------------------------------------- 6\n",
      "now_brand_date_second_values_rate --------------------------- 6\n",
      "now_date_dc_prom_ok ----------------------------------------- 6\n",
      "now_date_third_prom_6 --------------------------------------- 6\n",
      "now_date_third_prom_ok -------------------------------------- 6\n",
      "now_dc_sku_prom_times --------------------------------------- 5\n",
      "hist_third_prom_6 ------------------------------------------- 5\n",
      "hist_brand_dc_sku_discount ---------------------------------- 5\n",
      "now_date_third_values_rate ---------------------------------- 5\n",
      "now_date_first_attr_values ---------------------------------- 5\n",
      "hist_brand_dc_first_prom_10 --------------------------------- 5\n",
      "hist_brand_prom_ok ------------------------------------------ 5\n",
      "hist_brand_third_prom_10 ------------------------------------ 5\n",
      "now_dc_second_attr_values ----------------------------------- 5\n",
      "now_brand_dc_third_prom_1 ----------------------------------- 5\n",
      "hist_brand_dc_third_prom_ok --------------------------------- 5\n",
      "now_date_attr_values ---------------------------------------- 5\n",
      "hist_dc_sku_attr -------------------------------------------- 5\n",
      "hist_third_or_price ----------------------------------------- 5\n",
      "hist_third_prom_10 ------------------------------------------ 5\n",
      "hist_dc_third_attr_values ----------------------------------- 5\n",
      "hist_brand_dc_second_attr_values ---------------------------- 5\n",
      "hist_brand_dc_values_rate ----------------------------------- 5\n",
      "now_brand_third_prom_6 -------------------------------------- 5\n",
      "now_brand_values_rate --------------------------------------- 5\n",
      "now_brand_date_third_prom_10 -------------------------------- 5\n",
      "now_third_values_rate --------------------------------------- 5\n",
      "hist_brand_dc_third_prom_6 ---------------------------------- 5\n",
      "now_brand_date_prom_1 --------------------------------------- 5\n",
      "now_brand_date_third_prom_1 --------------------------------- 4\n",
      "now_brand_dc_third_prom_ok ---------------------------------- 4\n",
      "now_brand_dc_sku_prom_ok ------------------------------------ 4\n",
      "hist_dc_first_quantity -------------------------------------- 4\n",
      "hist_brand_prom_4 ------------------------------------------- 4\n",
      "now_brand_date_dc_second_prom_1 ----------------------------- 4\n",
      "hist_brand_second_or_price ---------------------------------- 4\n",
      "now_brand_dc_third_values_rate ------------------------------ 4\n",
      "now_date_dc_first_prom_ok ----------------------------------- 4\n",
      "hist_brand_first_prom_4 ------------------------------------- 4\n",
      "now_brand_sku_prom_6 ---------------------------------------- 4\n",
      "now_brand_attr_values --------------------------------------- 4\n",
      "hist_second_values_rate ------------------------------------- 4\n",
      "now_brand_third_prom_times ---------------------------------- 4\n",
      "now_brand_dc_third_prom_10 ---------------------------------- 4\n",
      "hist_dc_first_prom_4 ---------------------------------------- 4\n",
      "now_date_second_attr ---------------------------------------- 4\n",
      "now_brand_date_second_attr_values --------------------------- 4\n",
      "now_brand_dc_sku_prom_10 ------------------------------------ 4\n",
      "now_brand_first_prom_10 ------------------------------------- 4\n",
      "now_sku_prom_6 ---------------------------------------------- 4\n",
      "now_date_dc_first_prom_4 ------------------------------------ 4\n",
      "hist_brand_dc_prom_ok --------------------------------------- 4\n",
      "now_brand_second_attr_values -------------------------------- 4\n",
      "hist_brand_dc_second_attr ----------------------------------- 4\n",
      "qi_third ---------------------------------------------------- 4\n",
      "now_date_second_prom_ok ------------------------------------- 4\n",
      "hist_dc_second_attr ----------------------------------------- 4\n",
      "hist_brand_dc_second_prom_4 --------------------------------- 4\n",
      "now_dc_third_prom_4 ----------------------------------------- 4\n",
      "hist_brand_first_discount ----------------------------------- 4\n",
      "now_date_second_values_rate --------------------------------- 4\n",
      "now_brand_dc_prom_ok ---------------------------------------- 4\n",
      "hist_brand_dc_third_attr_values ----------------------------- 4\n",
      "hist_brand_dc_first_prom_6 ---------------------------------- 4\n",
      "hist_brand_dc_second_values_rate ---------------------------- 4\n",
      "now_brand_dc_prom_10 ---------------------------------------- 4\n",
      "now_brand_prom_6 -------------------------------------------- 4\n",
      "hist_dc_first_values_rate ----------------------------------- 3\n",
      "now_brand_date_dc_second_prom_times ------------------------- 3\n",
      "hist_brand_third_attr_values -------------------------------- 3\n",
      "now_sku_attr ------------------------------------------------ 3\n",
      "hist_brand_dc_first_attr ------------------------------------ 3\n",
      "now_brand_third_values_rate --------------------------------- 3\n",
      "now_date_first_prom_4 --------------------------------------- 3\n",
      "hist_brand_dc_sku_prom_4 ------------------------------------ 3\n",
      "hist_brand_dc_sku_prom_1 ------------------------------------ 3\n",
      "hist_brand_first_attr --------------------------------------- 3\n",
      "now_date_second_prom_6 -------------------------------------- 3\n",
      "hist_brand_dc_sku_prom_10 ----------------------------------- 3\n",
      "hist_dc_second_or_price ------------------------------------- 3\n",
      "hist_third_prom_ok ------------------------------------------ 3\n",
      "now_dc_sku_prom_10 ------------------------------------------ 3\n",
      "attr -------------------------------------------------------- 3\n",
      "hist_third_attr --------------------------------------------- 3\n",
      "now_brand_dc_second_prom_10 --------------------------------- 3\n",
      "now_sku_values_rate ----------------------------------------- 3\n",
      "now_date_dc_third_prom_4 ------------------------------------ 3\n",
      "now_date_dc_third_prom_6 ------------------------------------ 3\n",
      "now_dc_third_prom_ok ---------------------------------------- 3\n",
      "now_brand_attr ---------------------------------------------- 3\n",
      "hist_brand_dc_first_vend ------------------------------------ 3\n",
      "now_dc_second_prom_ok --------------------------------------- 3\n",
      "hist_brand_first_prom_ok ------------------------------------ 3\n",
      "now_date_dc_first_prom_10 ----------------------------------- 3\n",
      "now_date_prom_4 --------------------------------------------- 3\n",
      "now_dc_second_values_rate ----------------------------------- 3\n",
      "now_brand_date_dc_first_prom_times -------------------------- 3\n",
      "now_brand_prom_ok ------------------------------------------- 3\n",
      "hist_brand_dc_first_prom_ok --------------------------------- 3\n",
      "hist_brand_dc_first_prom_1 ---------------------------------- 3\n",
      "hist_dc_second_prom_6 --------------------------------------- 3\n",
      "hist_dc_second_prom_1 --------------------------------------- 3\n",
      "hist_brand_dc_sku_vend -------------------------------------- 3\n",
      "hist_dc_second_discount ------------------------------------- 3\n",
      "now_brand_dc_prom_4 ----------------------------------------- 3\n",
      "hist_brand_dc_third_prom_4 ---------------------------------- 3\n",
      "prom_10 ----------------------------------------------------- 3\n",
      "hist_brand_dc_third_attr ------------------------------------ 2\n",
      "now_date_dc_third_attr -------------------------------------- 2\n",
      "now_brand_date_dc_third_prom_times -------------------------- 2\n",
      "now_brand_first_values_rate --------------------------------- 2\n",
      "hist_brand_attr_values -------------------------------------- 2\n",
      "hist_dc_sku_prom_6 ------------------------------------------ 2\n",
      "hist_brand_dc_first_or_price -------------------------------- 2\n",
      "now_date_dc_prom_4 ------------------------------------------ 2\n",
      "now_brand_date_prom_10 -------------------------------------- 2\n",
      "hist_brand_sku_values_rate ---------------------------------- 2\n",
      "hist_brand_values_rate -------------------------------------- 2\n",
      "now_brand_dc_first_prom_times ------------------------------- 2\n",
      "hist_second_prom_times -------------------------------------- 2\n",
      "hist_second_attr_values ------------------------------------- 2\n",
      "now_brand_second_prom_6 ------------------------------------- 2\n",
      "now_third_prom_4 -------------------------------------------- 2\n",
      "hist_brand_dc_attr_values ----------------------------------- 2\n",
      "now_brand_first_prom_1 -------------------------------------- 2\n",
      "now_brand_first_prom_4 -------------------------------------- 2\n",
      "now_brand_first_prom_6 -------------------------------------- 2\n",
      "now_date_third_attr_values ---------------------------------- 2\n",
      "now_date_dc_second_prom_4 ----------------------------------- 2\n",
      "prom_1 ------------------------------------------------------ 2\n",
      "hist_brand_second_prom_4 ------------------------------------ 2\n",
      "now_brand_date_dc_prom_times -------------------------------- 2\n",
      "now_dc_third_attr ------------------------------------------- 2\n",
      "hist_dc_second_prom_ok -------------------------------------- 2\n",
      "hist_brand_third_attr --------------------------------------- 2\n",
      "now_date_dc_first_attr_values ------------------------------- 2\n",
      "now_dc_first_attr_values ------------------------------------ 2\n",
      "now_brand_date_sku_prom_10 ---------------------------------- 2\n",
      "now_brand_second_prom_times --------------------------------- 2\n",
      "hist_brand_third_values_rate -------------------------------- 2\n",
      "now_dc_third_attr_values ------------------------------------ 2\n",
      "now_brand_dc_third_prom_times ------------------------------- 2\n",
      "now_brand_dc_sku_prom_times --------------------------------- 2\n",
      "now_brand_date_second_prom_ok ------------------------------- 2\n",
      "now_brand_third_attr_values --------------------------------- 2\n",
      "now_brand_dc_second_attr ------------------------------------ 2\n",
      "hist_brand_dc_sku_prom_ok ----------------------------------- 2\n",
      "hist_second_or_price ---------------------------------------- 2\n",
      "hist_brand_second_values_rate ------------------------------- 2\n",
      "now_date_dc_third_prom_ok ----------------------------------- 2\n",
      "now_brand_date_prom_times ----------------------------------- 2\n",
      "now_brand_dc_second_prom_times ------------------------------ 2\n",
      "now_brand_date_third_prom_ok -------------------------------- 2\n",
      "now_brand_date_dc_third_values_rate ------------------------- 2\n",
      "now_brand_third_prom_4 -------------------------------------- 2\n",
      "hist_brand_dc_first_attr_values ----------------------------- 2\n",
      "hist_brand_sku_attr ----------------------------------------- 2\n",
      "now_second_prom_ok ------------------------------------------ 2\n",
      "hist_dc_first_or_price -------------------------------------- 2\n",
      "hist_brand_dc_first_prom_4 ---------------------------------- 2\n",
      "now_brand_date_dc_second_prom_10 ---------------------------- 2\n",
      "now_brand_dc_first_prom_ok ---------------------------------- 2\n",
      "hist_brand_first_prom_10 ------------------------------------ 2\n",
      "now_date_third_prom_4 --------------------------------------- 2\n",
      "hist_sku_attr_values ---------------------------------------- 1\n",
      "hist_brand_first_or_price ----------------------------------- 1\n",
      "now_brand_date_third_prom_6 --------------------------------- 1\n",
      "hist_dc_second_prom_times ----------------------------------- 1\n",
      "now_brand_date_dc_values_rate ------------------------------- 1\n",
      "now_brand_dc_second_prom_ok --------------------------------- 1\n",
      "now_brand_dc_second_prom_1 ---------------------------------- 1\n",
      "now_brand_date_dc_second_attr_values ------------------------ 1\n",
      "hist_brand_attr --------------------------------------------- 1\n",
      "qi_second --------------------------------------------------- 1\n",
      "now_brand_date_sku_prom_times ------------------------------- 1\n",
      "now_brand_date_dc_third_prom_1 ------------------------------ 1\n",
      "now_brand_date_first_prom_6 --------------------------------- 1\n",
      "now_date_dc_third_attr_values ------------------------------- 1\n",
      "now_date_dc_first_attr -------------------------------------- 1\n",
      "now_brand_second_prom_4 ------------------------------------- 1\n",
      "now_dc_first_prom_10 ---------------------------------------- 1\n",
      "now_brand_dc_second_prom_4 ---------------------------------- 1\n",
      "now_date_sku_prom_times ------------------------------------- 1\n",
      "now_brand_date_dc_first_prom_1 ------------------------------ 1\n",
      "prom_times -------------------------------------------------- 1\n",
      "now_brand_date_first_prom_ok -------------------------------- 1\n",
      "now_date_third_attr ----------------------------------------- 1\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hist_dc_first_vend ------------------------------------------ 1\n",
      "hist_dc_sku_values_rate ------------------------------------- 1\n",
      "hist_dc_prom_6 ---------------------------------------------- 1\n",
      "now_date_second_prom_4 -------------------------------------- 1\n",
      "prom_6 ------------------------------------------------------ 1\n",
      "now_brand_dc_first_prom_6 ----------------------------------- 1\n",
      "now_third_attr ---------------------------------------------- 1\n",
      "hist_dc_first_prom_times ------------------------------------ 1\n",
      "now_dc_second_attr ------------------------------------------ 1\n",
      "now_date_first_values_rate ---------------------------------- 1\n",
      "now_brand_date_dc_sku_prom_10 ------------------------------- 1\n",
      "hist_dc_first_prom_ok --------------------------------------- 1\n",
      "now_brand_date_third_prom_times ----------------------------- 1\n",
      "now_date_first_prom_ok -------------------------------------- 1\n",
      "now_second_prom_4 ------------------------------------------- 1\n",
      "now_second_prom_1 ------------------------------------------- 1\n",
      "hist_dc_second_attr_values ---------------------------------- 1\n",
      "now_third_prom_ok ------------------------------------------- 1\n",
      "now_brand_dc_values_rate ------------------------------------ 1\n",
      "now_brand_second_prom_ok ------------------------------------ 1\n",
      "now_brand_dc_third_prom_4 ----------------------------------- 1\n",
      "hist_dc_values_rate ----------------------------------------- 1\n",
      "now_dc_first_attr ------------------------------------------- 1\n",
      "now_brand_dc_first_attr_values ------------------------------ 1\n",
      "now_date_dc_second_prom_ok ---------------------------------- 1\n",
      "hist_brand_dc_sku_attr -------------------------------------- 1\n",
      "now_dc_second_prom_times ------------------------------------ 1\n",
      "hist_third_attr_values -------------------------------------- 1\n",
      "hist_dc_first_prom_6 ---------------------------------------- 1\n",
      "hist_brand_dc_first_values_rate ----------------------------- 1\n",
      "now_brand_date_second_attr ---------------------------------- 1\n",
      "now_brand_dc_first_prom_4 ----------------------------------- 1\n",
      "now_brand_date_first_values_rate ---------------------------- 1\n",
      "now_brand_dc_first_prom_10 ---------------------------------- 1\n",
      "now_brand_dc_second_values_rate ----------------------------- 1\n",
      "now_brand_date_dc_prom_1 ------------------------------------ 1\n",
      "hist_dc_second_prom_10 -------------------------------------- 1\n",
      "now_brand_date_first_attr ----------------------------------- 1\n",
      "now_brand_dc_third_attr_values ------------------------------ 1\n",
      "hist_dc_second_vend ----------------------------------------- 1\n",
      "now_brand_date_dc_prom_ok ----------------------------------- 1\n",
      "now_brand_date_first_prom_10 -------------------------------- 1\n",
      "now_brand_date_attr ----------------------------------------- 1\n",
      "now_date_first_prom_10 -------------------------------------- 1\n",
      "hist_second_prom_1 ------------------------------------------ 1\n",
      "hist_second_prom_6 ------------------------------------------ 1\n",
      "hist_second_prom_4 ------------------------------------------ 1\n",
      "now_brand_date_dc_third_prom_10 ----------------------------- 1\n",
      "now_brand_sku_attr_values ----------------------------------- 1\n",
      "now_brand_date_third_attr_values ---------------------------- 1\n",
      "hist_sku_attr ----------------------------------------------- 1\n",
      "hist_dc_first_prom_10 --------------------------------------- 1\n",
      "now_brand_dc_second_attr_values ----------------------------- 1\n",
      "now_brand_date_prom_4 --------------------------------------- 1\n",
      "now_brand_sku_values_rate ----------------------------------- 1\n",
      "now_brand_third_attr ---------------------------------------- 1\n",
      "now_brand_prom_4 -------------------------------------------- 1\n"
     ]
    }
   ],
   "source": [
    "qq=model.get_fscore()\n",
    "a=sorted(qq,key=lambda x:qq[x],reverse=True)\n",
    "print len(a)\n",
    "for i in a:\n",
    "    print i,'-'*(60-len(i)),qq[i]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 194,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[\n",
      "'hist_brand_sku_quantity' ,\n",
      "'hist_dc_sku_quantity' ,\n",
      "'hist_brand_dc_sku_quantity' ,\n",
      "'hist_brand_sku_discount' ,\n",
      "'hist_brand_third_quantity' ,\n",
      "'hist_brand_sku_prom_1' ,\n",
      "'hist_dc_third_or_price' ,\n",
      "'hist_brand_sku_prom_ok' ,\n",
      "'hist_brand_sku_or_price' ,\n",
      "'hist_brand_third_discount' ,\n",
      "'hist_brand_sku_vend' ,\n",
      "'hist_brand_prom_6' ,\n",
      "'hist_brand_sku_prom_10' ,\n",
      "'hist_brand_dc_prom_4' ,\n",
      "'now_date_values_rate' ,\n",
      "'hist_brand_third_vend' ,\n",
      "'hist_brand_second_discount' ,\n",
      "'hist_brand_third_or_price' ,\n",
      "'hist_dc_sku_or_price' ,\n",
      "'now_brand_sku_prom_1' ,\n",
      "'hist_brand_vend' ,\n",
      "'hist_brand_sku_prom_times' ,\n",
      "'now_date_attr' ,\n",
      "'hist_brand_dc_third_quantity' ,\n",
      "'now_brand_third_prom_1' ,\n",
      "'now_brand_sku_prom_10' ,\n",
      "'hist_dc_sku_prom_times' ,\n",
      "'hist_brand_dc_third_discount' ,\n",
      "'now_date_dc_prom_1' ,\n",
      "'now_dc_third_prom_ok' ,\n",
      "'now_date_first_prom_6' ,\n",
      "'hist_dc_sku_prom_1' ,\n",
      "'hist_brand_dc_third_or_price' ,\n",
      "'hist_brand_first_prom_6' ,\n",
      "]\n"
     ]
    }
   ],
   "source": [
    "print '['\n",
    "for i in a:\n",
    "    if qq[i]>=70:\n",
    "        print \"'\"+i+\"'\",','\n",
    "print ']'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 195,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "34\n"
     ]
    }
   ],
   "source": [
    "import_feature=[\n",
    "'hist_brand_sku_quantity' ,\n",
    "'hist_dc_sku_quantity' ,\n",
    "'hist_brand_dc_sku_quantity' ,\n",
    "'hist_brand_sku_discount' ,\n",
    "'hist_brand_third_quantity' ,\n",
    "'hist_brand_sku_prom_1' ,\n",
    "'hist_dc_third_or_price' ,\n",
    "'hist_brand_sku_prom_ok' ,\n",
    "'hist_brand_sku_or_price' ,\n",
    "'hist_brand_third_discount' ,\n",
    "'hist_brand_sku_vend' ,\n",
    "'hist_brand_prom_6' ,\n",
    "'hist_brand_sku_prom_10' ,\n",
    "'hist_brand_dc_prom_4' ,\n",
    "'now_date_values_rate' ,\n",
    "'hist_brand_third_vend' ,\n",
    "'hist_brand_second_discount' ,\n",
    "'hist_brand_third_or_price' ,\n",
    "'hist_dc_sku_or_price' ,\n",
    "'now_brand_sku_prom_1' ,\n",
    "'hist_brand_vend' ,\n",
    "'hist_brand_sku_prom_times' ,\n",
    "'now_date_attr' ,\n",
    "'hist_brand_dc_third_quantity' ,\n",
    "'now_brand_third_prom_1' ,\n",
    "'now_brand_sku_prom_10' ,\n",
    "'hist_dc_sku_prom_times' ,\n",
    "'hist_brand_dc_third_discount' ,\n",
    "'now_date_dc_prom_1' ,\n",
    "'now_dc_third_prom_ok' ,\n",
    "'now_date_first_prom_6' ,\n",
    "'hist_dc_sku_prom_1' ,\n",
    "'hist_brand_dc_third_or_price' ,\n",
    "'hist_brand_first_prom_6' ,\n",
    "]\n",
    "print len(import_feature)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 197,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(103047, 35)\n",
      "(186000, 34)\n"
     ]
    }
   ],
   "source": [
    "tt=pd.DataFrame()\n",
    "for i in import_feature:\n",
    "    tt[i]=train201701_hist_now[i]\n",
    "tt['quantity']=train201701_hist_now['quantity']\n",
    "uu=pd.DataFrame()\n",
    "for i in import_feature:\n",
    "    uu[i]=train201801_hist_now[i]\n",
    "print tt.shape\n",
    "print uu.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 243,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0]\ttrain-rmse:202.502\ttrain-my_eval:93.5586\n",
      "[1]\ttrain-rmse:202.501\ttrain-my_eval:93.0332\n",
      "[2]\ttrain-rmse:202.499\ttrain-my_eval:92.5126\n",
      "[3]\ttrain-rmse:202.498\ttrain-my_eval:92.0095\n",
      "[4]\ttrain-rmse:202.496\ttrain-my_eval:91.4962\n",
      "[5]\ttrain-rmse:202.495\ttrain-my_eval:91.0002\n",
      "[6]\ttrain-rmse:202.494\ttrain-my_eval:90.4942\n",
      "[7]\ttrain-rmse:202.493\ttrain-my_eval:90.0048\n",
      "[8]\ttrain-rmse:202.491\ttrain-my_eval:89.5039\n",
      "[9]\ttrain-rmse:202.49\ttrain-my_eval:89.0056\n",
      "[10]\ttrain-rmse:202.489\ttrain-my_eval:88.512\n",
      "[11]\ttrain-rmse:202.487\ttrain-my_eval:88.0201\n",
      "[12]\ttrain-rmse:202.486\ttrain-my_eval:87.5323\n",
      "[13]\ttrain-rmse:202.485\ttrain-my_eval:87.048\n",
      "[14]\ttrain-rmse:202.483\ttrain-my_eval:86.5637\n",
      "[15]\ttrain-rmse:202.482\ttrain-my_eval:86.0821\n",
      "[16]\ttrain-rmse:202.481\ttrain-my_eval:85.6045\n",
      "[17]\ttrain-rmse:202.479\ttrain-my_eval:85.1292\n",
      "[18]\ttrain-rmse:202.478\ttrain-my_eval:84.6517\n",
      "[19]\ttrain-rmse:202.477\ttrain-my_eval:84.1804\n",
      "[20]\ttrain-rmse:202.475\ttrain-my_eval:83.7064\n",
      "[21]\ttrain-rmse:202.474\ttrain-my_eval:83.2418\n",
      "[22]\ttrain-rmse:202.473\ttrain-my_eval:82.7798\n",
      "[23]\ttrain-rmse:202.472\ttrain-my_eval:82.3206\n",
      "[24]\ttrain-rmse:202.47\ttrain-my_eval:81.8561\n",
      "[25]\ttrain-rmse:202.469\ttrain-my_eval:81.4368\n",
      "[26]\ttrain-rmse:202.468\ttrain-my_eval:81.0983\n",
      "[27]\ttrain-rmse:202.466\ttrain-my_eval:80.7594\n",
      "[28]\ttrain-rmse:202.465\ttrain-my_eval:80.4387\n",
      "[29]\ttrain-rmse:202.464\ttrain-my_eval:80.1255\n",
      "[30]\ttrain-rmse:202.462\ttrain-my_eval:79.8166\n"
     ]
    },
    {
     "ename": "KeyboardInterrupt",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mKeyboardInterrupt\u001b[0m                         Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-243-c6ebe8c890e1>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m    109\u001b[0m \u001b[0mtest_xgb\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mxgb\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mDMatrix\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtest_X\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mlabel\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mtest_Y\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mfeature_names\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mtest_X\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcolumns\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    110\u001b[0m \u001b[0mwatchlist\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtrain_xgb\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'train'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 111\u001b[1;33m \u001b[0mmodel\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mxgb\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtrain\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mparams\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mtrain_xgb\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mnum_boost_round\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m1000\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mfeval\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mget_evafunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0minfo201701\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0minfo201801\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mobj\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mget_loss\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0minfo201701\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0minfo201801\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mevals\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mwatchlist\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    112\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    113\u001b[0m \u001b[0mcost_time\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mtime\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtime\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m-\u001b[0m\u001b[0mstart_time\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mC:\\Users\\coding\\Anaconda2\\lib\\site-packages\\xgboost\\training.pyc\u001b[0m in \u001b[0;36mtrain\u001b[1;34m(params, dtrain, num_boost_round, evals, obj, feval, maximize, early_stopping_rounds, evals_result, verbose_eval, xgb_model, callbacks, learning_rates)\u001b[0m\n\u001b[0;32m    202\u001b[0m                            \u001b[0mevals\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mevals\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    203\u001b[0m                            \u001b[0mobj\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mobj\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mfeval\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mfeval\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 204\u001b[1;33m                            xgb_model=xgb_model, callbacks=callbacks)\n\u001b[0m\u001b[0;32m    205\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    206\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mC:\\Users\\coding\\Anaconda2\\lib\\site-packages\\xgboost\\training.pyc\u001b[0m in \u001b[0;36m_train_internal\u001b[1;34m(params, dtrain, num_boost_round, evals, obj, feval, xgb_model, callbacks)\u001b[0m\n\u001b[0;32m     72\u001b[0m         \u001b[1;31m# Skip the first update if it is a recovery step.\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     73\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[0mversion\u001b[0m \u001b[1;33m%\u001b[0m \u001b[1;36m2\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 74\u001b[1;33m             \u001b[0mbst\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mupdate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdtrain\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mobj\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     75\u001b[0m             \u001b[0mbst\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msave_rabit_checkpoint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     76\u001b[0m             \u001b[0mversion\u001b[0m \u001b[1;33m+=\u001b[0m \u001b[1;36m1\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mC:\\Users\\coding\\Anaconda2\\lib\\site-packages\\xgboost\\core.pyc\u001b[0m in \u001b[0;36mupdate\u001b[1;34m(self, dtrain, iteration, fobj)\u001b[0m\n\u001b[0;32m    899\u001b[0m         \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    900\u001b[0m             \u001b[0mpred\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpredict\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdtrain\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 901\u001b[1;33m             \u001b[0mgrad\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mhess\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mfobj\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mpred\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdtrain\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    902\u001b[0m             \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mboost\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdtrain\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mgrad\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mhess\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    903\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m<ipython-input-243-c6ebe8c890e1>\u001b[0m in \u001b[0;36mlossfunc\u001b[1;34m(pred, dmat)\u001b[0m\n\u001b[0;32m     62\u001b[0m             \u001b[0me_delta\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mmath\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexp\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdelta\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     63\u001b[0m         \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mn\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 64\u001b[1;33m             \u001b[0mqiudao1\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m-\u001b[0m\u001b[0mk1\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m-\u001b[0m\u001b[0mk2\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m+\u001b[0m\u001b[0me_delta\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m+\u001b[0m\u001b[0mk2\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     65\u001b[0m             \u001b[0mqiudao2\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mk1\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m+\u001b[0m\u001b[0mk2\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m+\u001b[0m\u001b[0me_delta\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m**\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0me_delta\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     66\u001b[0m         \u001b[0mgrad\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mqiudao1\u001b[0m \u001b[1;31m#梯度\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mKeyboardInterrupt\u001b[0m: "
     ]
    }
   ],
   "source": [
    "def get_evafunc(info1,info2):\n",
    "    def evafunc(pred, dmat):\n",
    "        if pred.shape[0]==info1.shape[0]:\n",
    "            info=info1\n",
    "        if pred.shape[0]==info2.shape[0]:\n",
    "            info=info2\n",
    "        \n",
    "        op=info\n",
    "        \n",
    "        n=pred.shape[0]\n",
    "        \n",
    "        #start_time1 = time.time()\n",
    "        \n",
    "        label=np.array(op['quantity'])\n",
    "        i=np.array(op['sku_id'])\n",
    "        j=np.array(op['dc_id'])\n",
    "        qi=np.array(op['quantile'])\n",
    "        k1=np.array(op['k1'])\n",
    "        k2=np.array(op['k2'])\n",
    "        \n",
    "        #cost_time1 = time.time()-start_time1\n",
    "        #start_time2 = time.time()\n",
    "        \n",
    "        L=np.zeros((1001,6))\n",
    "        N=np.zeros((1001,6))\n",
    "        for ind in range(n):\n",
    "            if label[ind]>pred[ind]:\n",
    "                L[i[ind]][j[ind]]+=k1[ind]*(label[ind]-pred[ind])\n",
    "                N[i[ind]][j[ind]]+=1\n",
    "            else:\n",
    "                L[i[ind]][j[ind]]+=k2[ind]*(pred[ind]-label[ind])\n",
    "                N[i[ind]][j[ind]]+=1\n",
    "        ans=0\n",
    "        for i in range(1001):\n",
    "            for j in range(6):\n",
    "                if N[i][j]!=0:\n",
    "                    ans+=L[i][j]/N[i][j]\n",
    "        myeval=ans\n",
    "        \n",
    "        #cost_time2 = time.time()-start_time2\n",
    "        #print \"cost time1:\",cost_time1,\"(s)\",\"cost time2:\",cost_time2,\"(s)\",cost_time1/cost_time2\n",
    "        \n",
    "        \n",
    "        return 'my_eval',myeval\n",
    "    return evafunc\n",
    "def get_loss(info1,info2):\n",
    "    def lossfunc(pred, dmat): #自定义损失函数\n",
    "        if pred.shape[0]==info1.shape[0]:\n",
    "            info=info1\n",
    "        if pred.shape[0]==info2.shape[0]:\n",
    "            info=info2\n",
    "        n=pred.shape[0]\n",
    "        \n",
    "        delta=pred-np.array(info['quantity'])\n",
    "        k1=np.array(info.k1)\n",
    "        k2=np.array(info.k2)\n",
    "        import math\n",
    "        e_delta=np.zeros(n)\n",
    "        qiudao1=np.zeros(n)\n",
    "        qiudao2=np.zeros(n)\n",
    "        for i in range(n):\n",
    "            e_delta[i]=math.exp(delta[i])\n",
    "        for i in range(n):\n",
    "            qiudao1[i]=(-k1[i]-k2[i])/(1+e_delta[i])+k2[i]\n",
    "            qiudao2[i]=(k1[i]+k2[i])/((1+e_delta[i])**2)*e_delta[i]\n",
    "        grad=qiudao1 #梯度\n",
    "        hess=qiudao2\n",
    "        return grad,hess\n",
    "    return lossfunc\n",
    "\n",
    "import xgboost as xgb\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "from xgboost.sklearn import XGBClassifier\n",
    "from sklearn import cross_validation,metrics\n",
    "from sklearn.grid_search import GridSearchCV\n",
    "\n",
    "import time \n",
    "start_time = time.time()\n",
    "params={\n",
    "'booster':'gbtree',\n",
    "#'objective': 'reg:linear', #线性回归的问题\n",
    "#'eval_metric':'auc',\n",
    "'gamma':0.15,  # 用于控制是否后剪枝的参数,越大越保守，一般0.1、0.2这样子。\n",
    "'min_child_weight':3,\n",
    "'max_depth':5, # 构建树的深度，越大越容易过拟合\n",
    "'lambda':10,  # 控制模型复杂度的权重值的L2正则化项参数，参数越大，模型越不容易过拟合。\n",
    "'subsample':0.7, # 随机采样训练样本#0.7\n",
    "'colsample_bytree':0.7, # 生成树时进行的列采样#0.7\n",
    "'colsample_bylevel':0.7,\n",
    "#'min_child_weight':3, \n",
    "# 这个参数默认是 1，是每个叶子里面 h 的和至少是多少，对正负样本不均衡时的 0-1 分类而言\n",
    "#，假设 h 在 0.01 附近，min_child_weight 为 1 意味着叶子节点中最少需要包含 100 个样本。\n",
    "#这个参数非常影响结果，控制叶子节点中二阶导的和的最小值，该参数值越小，越容易 overfitting。 \n",
    "'silent':0 ,#设置成1则没有运行信息输出，最好是设置为0.\n",
    "'eta': 0.01, # 如同学习率\n",
    "'tree_method':'exact',\n",
    "'seed':10,\n",
    "#'nthread':12\n",
    "#'nthread':,# cpu 线程数\n",
    "#'eval_metric': 'auc'\n",
    "}\n",
    "train_X=tt.drop(['quantity'],axis=1)\n",
    "train_Y=tt['quantity']\n",
    "\n",
    "test_X=uu\n",
    "\n",
    "train_xgb=xgb.DMatrix(train_X,label=train_Y,feature_names=train_X.columns)\n",
    "test_xgb=xgb.DMatrix(test_X,label=test_Y,feature_names=test_X.columns)\n",
    "watchlist=[(train_xgb,'train')]\n",
    "model=xgb.train(params,train_xgb,num_boost_round=1000,feval=get_evafunc(info201701,info201801),obj=get_loss(info201701,info201801),evals=watchlist)\n",
    "\n",
    "cost_time = time.time()-start_time\n",
    "print \"xgboost success!\",'\\n',\"cost time:\",cost_time,\"(s)\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 207,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "\n",
    "op=info201701\n",
    "#aans=pd.DataFrame()\n",
    "#aans['label']=op['quantity']\n",
    "#aans['pred']=pd.Series(pred)\n",
    "#aans['i']=op['sku_id']\n",
    "#aans['j']=op['dc_id']\n",
    "#aans['qi']=op['quantile']\n",
    "#aans['k1']=op.k1\n",
    "#aans['k2']=op.k2\n",
    "train_X=train201701_hist_now.drop(['quantity'],axis=1)\n",
    "train_Y=train201701_hist_now['quantity']\n",
    "\n",
    "test_X=train201712_hist_now.drop(['quantity'],axis=1)\n",
    "test_Y=train201712_hist_now['quantity']\n",
    "\n",
    "train_xgb=xgb.DMatrix(train_X,label=train_Y,feature_names=train_X.columns)\n",
    "test_xgb=xgb.DMatrix(test_X,label=test_Y,feature_names=test_X.columns)\n",
    "pred=model.predict(train_xgb)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 232,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 0.  0.  2. ...,  0.  1.  0.]\n"
     ]
    },
    {
     "ename": "TypeError",
     "evalue": "only length-1 arrays can be converted to Python scalars",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-232-72e4571a76be>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mmath\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      2\u001b[0m \u001b[1;32mprint\u001b[0m \u001b[0mlabel\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m \u001b[1;32mprint\u001b[0m \u001b[0mmath\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexp\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mlabel\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m: only length-1 arrays can be converted to Python scalars"
     ]
    }
   ],
   "source": [
    "import math\n",
    "print label\n",
    "print math.exp(label)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 236,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[-0.00013811  0.00010094  0.00018072 ...,  0.00387772  0.00303945\n",
      "  0.00630096]\n"
     ]
    }
   ],
   "source": [
    "\n",
    "start_time = time.time()\n",
    "\n",
    "cost_time = time.time()-start_time\n",
    "print \"xgboost success!\",'\\n',\"cost time:\",cost_time,\"(s)\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 237,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[-0.00013811  0.00010094  0.00018072 ...,  0.00387772  0.00303945\n",
      "  0.00630096]\n"
     ]
    }
   ],
   "source": [
    "op=info201701\n",
    "ans=pd.DataFrame()\n",
    "        \n",
    "ans['pred']=pd.Series(pred)\n",
    "ans['delta']=ans['pred']-info['quantity']\n",
    "ans['k1']=info.k1\n",
    "ans['k2']=info.k2\n",
    "import math\n",
    "ans['e_delta']=ans.delta.map(lambda x:math.exp(x))\n",
    "ans['qiudao1']=ans.apply(lambda x:(-x.k1-x.k2)/(1+x.e_delta)+x.k2,axis=1)\n",
    "ans['qiudao2']=ans.apply(lambda x:(x.k1+x.k2)/((1+x.e_delta)**2)*x.e_delta,axis=1)\n",
    "grad=np.array(ans.qiudao1) #梯度\n",
    "hess=np.array(ans.qiudao2)\n",
    "\n",
    "print grad"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
